2021-12-24 04:21:11 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# Python dependencies
|
2022-08-12 12:06:08 +00:00
|
|
|
, numpy
|
2021-12-24 04:21:11 +00:00
|
|
|
, openpyxl
|
|
|
|
, pandas
|
|
|
|
, pandas-stubs
|
|
|
|
, requests
|
2022-08-12 12:06:08 +00:00
|
|
|
, scikit-learn
|
|
|
|
, tenacity
|
2021-12-24 04:21:11 +00:00
|
|
|
, tqdm
|
2022-04-15 01:41:22 +00:00
|
|
|
, wandb
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
# Check dependencies
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "openai";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "0.22.1";
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
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}";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-QUnsm0ui1BFlLqAlH1bp7uDbhiRigePrAPAkSRjftM4=";
|
2021-12-24 04:21:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
numpy
|
2021-12-24 04:21:11 +00:00
|
|
|
openpyxl
|
|
|
|
pandas
|
|
|
|
pandas-stubs
|
|
|
|
requests
|
2022-08-12 12:06:08 +00:00
|
|
|
scikit-learn
|
|
|
|
tenacity
|
2021-12-24 04:21:11 +00:00
|
|
|
tqdm
|
2022-04-15 01:41:22 +00:00
|
|
|
wandb
|
2021-12-24 04:21:11 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|