1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

gnu: python-openai: Update to 1.3.5.

* gnu/packages/python-web.scm (python-openai): Update to 1.3.5.
[arguments]: Adjust list of disabled tests; add phase 'relax-requirements and
'httpx-compatibility.
[propagated-inputs]: Add python-distro, python-httpx, and python-pydantic-2.
[native-inputs]: Remove python-black; add python-dirty-equals,
python-hatchling, and nss-certs-for-test.

Change-Id: I47210abe6a7bc0f5141c41b2a60a45f3b83457ce
This commit is contained in:
Ricardo Wurmus
2025-04-07 20:25:01 +02:00
parent f61281317f
commit 666a6cfd88

View File

@@ -3016,13 +3016,16 @@ service.")
(define-public python-openai
(package
(name "python-openai")
(version "0.28.1")
(version "1.3.5")
(source (origin
(method url-fetch)
(uri (pypi-uri "openai" version))
(method git-fetch)
(uri (git-reference
(url "https://github.com/openai/openai-python")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"1j6wsavgrxzh6ls8hp45nllz8f5l65a6vzk0lvhlqnx6579xmqab"))))
"0k1rwhj7v22x5bnv9xbk9nj9grxqmmclh9538qqjadgqxfn5x74q"))))
(build-system pyproject-build-system)
(arguments
(list
@@ -3030,12 +3033,43 @@ service.")
;; These require internet access and an openai API key.
'(list "--ignore=openai/tests/asyncio/test_endpoints.py"
"--ignore=openai/tests/test_endpoints.py"
"--ignore-glob=tests/api_resources/*"
;; Needs respx
"--ignore=tests/api_resources/audio/test_speech.py"
"--ignore=tests/api_resources/test_files.py"
"--ignore=tests/test_client.py"
"-k" "not test_requestor_cycle_sessions\
and not test_requestor_sets_request_id\
and not test_file_cli")))
(propagated-inputs (list python-aiohttp python-requests python-tqdm
python-typing-extensions))
(native-inputs (list python-black python-pytest python-pytest-asyncio
and not test_file_cli\
and not test_basic_async\
and not test_async\
and not test_datetime_with_alias\
and not test_pydantic")
#:phases
'(modify-phases %standard-phases
(add-after 'unpack 'relax-requirements
(lambda _
(substitute* "pyproject.toml"
(("distro>=1.7.0") "distro>=1.6.0")
(("anyio>=3.5.0, <4") "anyio"))))
(add-after 'unpack 'httpx-compatibility
(lambda _
(substitute* "src/openai/_base_client.py"
(("proxies=proxies,") "")
(("self._proxies = proxies") "")
(("proxies: ProxiesTypes . None,") "")))))))
(propagated-inputs
(list python-aiohttp
python-distro
python-httpx
python-pydantic-2
python-requests
python-tqdm
python-typing-extensions))
(native-inputs (list nss-certs-for-test
python-dirty-equals
python-hatchling
python-pytest python-pytest-asyncio
python-pytest-mock python-setuptools python-wheel))
(home-page "https://github.com/openai/openai-python")
(synopsis "Python client library for the OpenAI API")