2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
anyio,
|
|
|
|
buildPythonPackage,
|
|
|
|
cached-property,
|
|
|
|
dirty-equals,
|
|
|
|
distro,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hatch-fancy-pypi-readme,
|
|
|
|
hatchling,
|
|
|
|
httpx,
|
|
|
|
numpy,
|
|
|
|
pandas,
|
|
|
|
pandas-stubs,
|
|
|
|
pydantic,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
respx,
|
|
|
|
sniffio,
|
|
|
|
tqdm,
|
|
|
|
typing-extensions,
|
2021-12-24 04:21:11 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "openai";
|
2024-06-24 18:47:55 +00:00
|
|
|
version = "1.35.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2021-12-24 04:21:11 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openai";
|
|
|
|
repo = "openai-python";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-06-24 18:47:55 +00:00
|
|
|
hash = "sha256-GOduJdMNVWK3Hl05mQI7kpgzugEX2MJKEqTyR/ldW9Q=";
|
2021-12-24 04:21:11 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [
|
2024-01-02 11:29:13 +00:00
|
|
|
hatchling
|
2024-04-21 15:54:59 +00:00
|
|
|
hatch-fancy-pypi-readme
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2024-01-02 11:29:13 +00:00
|
|
|
httpx
|
|
|
|
pydantic
|
2024-01-25 14:12:00 +00:00
|
|
|
typing-extensions
|
2024-01-02 11:29:13 +00:00
|
|
|
anyio
|
|
|
|
distro
|
|
|
|
sniffio
|
2021-12-24 04:21:11 +00:00
|
|
|
tqdm
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [ cached-property ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
2023-02-02 18:25:31 +00:00
|
|
|
datalib = [
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
pandas-stubs
|
2022-10-21 18:38:19 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "openai" ];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-10-21 18:38:19 +00:00
|
|
|
pytestCheckHook
|
2023-02-02 18:25:31 +00:00
|
|
|
pytest-asyncio
|
2022-10-21 18:38:19 +00:00
|
|
|
pytest-mock
|
2024-01-02 11:29:13 +00:00
|
|
|
respx
|
|
|
|
dirty-equals
|
2021-12-24 04:21:11 +00:00
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
pytestFlagsArray = [
|
2024-04-21 15:54:59 +00:00
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
2024-02-29 20:09:43 +00:00
|
|
|
];
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabledTests = [
|
2024-02-29 20:09:43 +00:00
|
|
|
# Tests make network requests
|
2024-01-25 14:12:00 +00:00
|
|
|
"test_streaming_response"
|
2024-02-29 20:09:43 +00:00
|
|
|
"test_copy_build_request"
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# Test fails with pytest>=8
|
|
|
|
"test_basic_attribute_access_works"
|
2024-01-13 08:15:51 +00:00
|
|
|
];
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
disabledTestPaths = [
|
2024-02-29 20:09:43 +00:00
|
|
|
# Test makes network requests
|
2024-01-02 11:29:13 +00:00
|
|
|
"tests/api_resources"
|
2021-12-24 04:21:11 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python client library for the OpenAI API";
|
|
|
|
homepage = "https://github.com/openai/openai-python";
|
2023-03-04 12:14:45 +00:00
|
|
|
changelog = "https://github.com/openai/openai-python/releases/tag/v${version}";
|
2021-12-24 04:21:11 +00:00
|
|
|
license = licenses.mit;
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ malo ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "openai";
|
2021-12-24 04:21:11 +00:00
|
|
|
};
|
|
|
|
}
|