Malo Bourgon 2024-01-17 10:13:10 -08:00
parent 2951dec6e1
commit ebc874c2fa

View file

@ -2,7 +2,6 @@
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, pythonOlder , pythonOlder
, pythonRelaxDepsHook
, hatchling , hatchling
# propagated # propagated
, httpx , httpx
@ -11,6 +10,7 @@
, anyio , anyio
, distro , distro
, sniffio , sniffio
, cached-property
, tqdm , tqdm
# optional # optional
, numpy , numpy
@ -26,38 +26,32 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "openai"; pname = "openai";
version = "1.7.1"; version = "1.9.0";
pyproject = true; pyproject = true;
disabled = pythonOlder "3.7.1"; disabled = pythonOlder "3.7.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "openai"; owner = "openai";
repo = "openai-python"; repo = "openai-python";
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-NXZ+7gDA3gMGSrmgceHxcR45LrXdazXbYuhcoUsNXew="; hash = "sha256-+3tCttKWbWt3Nsf5E6NWYt0yLRV0kfj7Qz6PhaOmBsY=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
hatchling hatchling
pythonRelaxDepsHook
];
pythonRelaxDeps = [
# https://github.com/openai/openai-python/issues/921
"anyio"
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
httpx httpx
pydantic pydantic
typing-extensions
anyio anyio
distro distro
sniffio sniffio
tqdm tqdm
] ++ lib.optionals (pythonOlder "3.8") [ ] ++ lib.optionals (pythonOlder "3.8") [
typing-extensions cached-property
]; ];
passthru.optional-dependencies = { passthru.optional-dependencies = {
@ -80,15 +74,13 @@ buildPythonPackage rec {
dirty-equals dirty-equals
]; ];
pytestFlagsArray = [ disabledTests = [
"-W" "ignore::DeprecationWarning" # makes network requests
"test_streaming_response"
]; ];
OPENAI_API_KEY = "sk-foo";
disabledTestPaths = [ disabledTestPaths = [
# makes network requests # makes network requests
"tests/test_client.py"
"tests/api_resources" "tests/api_resources"
]; ];