depot/third_party/nixpkgs/pkgs/development/python-modules/openai/default.nix
Default email b450903751 Project import generated by Copybara.
GitOrigin-RevId: 74a1793c659d09d7cf738005308b1f86c90cb59b
2022-09-09 16:08:57 +02:00

63 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
# Python dependencies
, numpy
, openpyxl
, pandas
, pandas-stubs
, requests
, scikit-learn
, tenacity
, tqdm
, wandb
# Check dependencies
, pytest-mock
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "openai";
version = "0.23.0";
disabled = pythonOlder "3.7.1";
# Use GitHub source since PyPi source does not include tests
src = fetchFromGitHub {
owner = "openai";
repo = "openai-python";
rev = "v${version}";
sha256 = "sha256-VH1XR2FocRX5AYpCruAKwQUXjXqvdJsVwKdtot5Bo+Y=";
};
propagatedBuildInputs = [
numpy
openpyxl
pandas
pandas-stubs
requests
scikit-learn
tenacity
tqdm
wandb
];
pythonImportsCheck = [ "openai" ];
checkInputs = [ pytestCheckHook pytest-mock ];
pytestFlagsArray = [ "openai/tests" ];
OPENAI_API_KEY = "sk-foo";
disabledTestPaths = [
"openai/tests/test_endpoints.py" # requires a real API key
"openai/tests/test_file_cli.py"
];
meta = with lib; {
description = "Python client library for the OpenAI API";
homepage = "https://github.com/openai/openai-python";
license = licenses.mit;
maintainers = [ maintainers.malo ];
};
}