depot/third_party/nixpkgs/pkgs/development/python-modules/openai/default.nix
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

86 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, matplotlib
, numpy
, openpyxl
, pandas
, pandas-stubs
, plotly
, pytest-mock
, pytestCheckHook
, pythonOlder
, requests
, scikit-learn
, tenacity
, tqdm
, typing-extensions
, wandb
}:
buildPythonPackage rec {
pname = "openai";
version = "0.24.0";
format = "setuptools";
disabled = pythonOlder "3.7.1";
src = fetchFromGitHub {
owner = "openai";
repo = "openai-python";
rev = "v${version}";
hash = "sha256-0bXJoEq8FHRNaFMjncIwDbJROtFz/IJ4gD+LfvmtFUg=";
};
propagatedBuildInputs = [
numpy
openpyxl
pandas
pandas-stubs
requests
tqdm
typing-extensions
];
passthru.optional-dependencies = {
wandb = [
wandb
];
embeddings = [
matplotlib
plotly
scikit-learn
tenacity
];
};
pythonImportsCheck = [
"openai"
];
checkInputs = [
pytestCheckHook
pytest-mock
];
pytestFlagsArray = [
"openai/tests"
];
OPENAI_API_KEY = "sk-foo";
disabledTestPaths = [
# Requires a real API key
"openai/tests/test_endpoints.py"
# openai: command not found
"openai/tests/test_file_cli.py"
"openai/tests/test_long_examples_validator.py"
];
meta = with lib; {
description = "Python client library for the OpenAI API";
homepage = "https://github.com/openai/openai-python";
license = licenses.mit;
maintainers = with maintainers; [ malo ];
};
}