Merge pull request #209934 from malob/update-openai

This commit is contained in:
Sandro 2023-01-24 13:53:05 +01:00 committed by GitHub
commit 5e46415165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,14 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, aiohttp
, matplotlib
, numpy
, openpyxl
, pandas
, pandas-stubs
, plotly
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonOlder
@ -16,11 +18,12 @@
, tqdm
, typing-extensions
, wandb
, withOptionalDependencies ? false
}:
buildPythonPackage rec {
pname = "openai";
version = "0.25.0";
version = "0.26.1";
format = "setuptools";
disabled = pythonOlder "3.7.1";
@ -29,29 +32,35 @@ buildPythonPackage rec {
owner = "openai";
repo = "openai-python";
rev = "v${version}";
hash = "sha256-bwv7lpdDYlk+y3KBjv7cSvaGr3v02riNCUfPFh6yv1I=";
hash = "sha256-M6ZaYTOBAwLogWPafSnBYw3rUry+sS9VwQWAM9tDfr8=";
};
propagatedBuildInputs = [
numpy
openpyxl
pandas
pandas-stubs
aiohttp
requests
tqdm
] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions
];
] ++ lib.optionals withOptionalDependencies (builtins.attrValues {
inherit (passthru.optional-dependencies) embeddings wandb;
});
passthru.optional-dependencies = {
wandb = [
wandb
datalib = [
numpy
openpyxl
pandas
pandas-stubs
];
embeddings = [
matplotlib
plotly
scikit-learn
tenacity
];
] ++ passthru.optional-dependencies.datalib;
wandb = [
wandb
] ++ passthru.optional-dependencies.datalib;
};
pythonImportsCheck = [
@ -60,6 +69,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-asyncio
pytest-mock
];
@ -72,6 +82,7 @@ buildPythonPackage rec {
disabledTestPaths = [
# Requires a real API key
"openai/tests/test_endpoints.py"
"openai/tests/asyncio/test_endpoints.py"
# openai: command not found
"openai/tests/test_file_cli.py"
"openai/tests/test_long_examples_validator.py"