python311Packages.openai: 0.28.1 -> 1.3.7
openai: cleanup
This commit is contained in:
parent
0108269b38
commit
5f69f0ed2e
@ -1,30 +1,32 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, aiohttp
|
||||
, matplotlib
|
||||
, pythonOlder
|
||||
, hatchling
|
||||
# propagated
|
||||
, httpx
|
||||
, pydantic
|
||||
, typing-extensions
|
||||
, anyio
|
||||
, distro
|
||||
, sniffio
|
||||
, tqdm
|
||||
# optional
|
||||
, numpy
|
||||
, openpyxl
|
||||
, pandas
|
||||
, pandas-stubs
|
||||
, plotly
|
||||
# tests
|
||||
, pytestCheckHook
|
||||
, pytest-asyncio
|
||||
, pytest-mock
|
||||
, pytestCheckHook
|
||||
, pythonOlder
|
||||
, requests
|
||||
, scikit-learn
|
||||
, tenacity
|
||||
, tqdm
|
||||
, typing-extensions
|
||||
, wandb
|
||||
, withOptionalDependencies ? false
|
||||
, respx
|
||||
, dirty-equals
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "openai";
|
||||
version = "0.28.1";
|
||||
format = "setuptools";
|
||||
version = "1.3.7";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7.1";
|
||||
|
||||
@ -32,35 +34,30 @@ buildPythonPackage rec {
|
||||
owner = "openai";
|
||||
repo = "openai-python";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-liJyeGxnYIC/jUQKdeATHpVJb/12KGbeM94Y2YQphfY=";
|
||||
hash = "sha256-Pa53s3U5vby1Fq14WMCJnSR6KA3xkVHmBexkNoX/0sk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
hatchling
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
aiohttp
|
||||
requests
|
||||
httpx
|
||||
pydantic
|
||||
anyio
|
||||
distro
|
||||
sniffio
|
||||
tqdm
|
||||
] ++ lib.optionals (pythonOlder "3.8") [
|
||||
typing-extensions
|
||||
] ++ lib.optionals withOptionalDependencies (builtins.attrValues {
|
||||
inherit (passthru.optional-dependencies) embeddings wandb;
|
||||
});
|
||||
];
|
||||
|
||||
passthru.optional-dependencies = {
|
||||
datalib = [
|
||||
numpy
|
||||
openpyxl
|
||||
pandas
|
||||
pandas-stubs
|
||||
];
|
||||
embeddings = [
|
||||
matplotlib
|
||||
plotly
|
||||
scikit-learn
|
||||
tenacity
|
||||
] ++ passthru.optional-dependencies.datalib;
|
||||
wandb = [
|
||||
wandb
|
||||
] ++ passthru.optional-dependencies.datalib;
|
||||
};
|
||||
|
||||
pythonImportsCheck = [
|
||||
@ -71,21 +68,16 @@ buildPythonPackage rec {
|
||||
pytestCheckHook
|
||||
pytest-asyncio
|
||||
pytest-mock
|
||||
];
|
||||
|
||||
pytestFlagsArray = [
|
||||
"openai/tests"
|
||||
respx
|
||||
dirty-equals
|
||||
];
|
||||
|
||||
OPENAI_API_KEY = "sk-foo";
|
||||
|
||||
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"
|
||||
# makes network requests
|
||||
"tests/test_client.py"
|
||||
"tests/api_resources"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -19711,10 +19711,6 @@ with pkgs;
|
||||
|
||||
openai = with python3Packages; toPythonApplication openai;
|
||||
|
||||
openai-full = with python3Packages; toPythonApplication (openai.override {
|
||||
withOptionalDependencies = true;
|
||||
});
|
||||
|
||||
openai-whisper = with python3.pkgs; toPythonApplication openai-whisper;
|
||||
|
||||
openai-whisper-cpp = darwin.apple_sdk_11_0.callPackage ../tools/audio/openai-whisper-cpp {
|
||||
|
Loading…
Reference in New Issue
Block a user