# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=hatchling PYTHON_COMPAT=( python3_{12..14} ) inherit distutils-r1 pypi DESCRIPTION="The official Python library for the openai API" HOMEPAGE=" https://github.com/openai/openai-python https://pypi.org/project/openai/ " LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64 ~arm64" # 3.6.0 dropped the distro dependency: _base_client.py now reads # platform.freedesktop_os_release() from the stdlib instead (verified in the # 3.6.0 sdist -- no `import distro` remains). The pydantic floor also rose # 1.9.0 -> 1.10.13; upstream additionally excludes pydantic 2.0.*-2.3.*, which # is unreachable here since ::gentoo's oldest pydantic is 2.13.4 -- so only # the `<3` half of that constraint is transcribed. # Upstream's other major ceilings are carried too: without them a future # ::gentoo bump to jiter 1.x, anyio 5.x or typing-extensions 5.x would be # silently accepted. sniffio is deliberately left unbounded -- openai declares # it bare, unlike anthropic which pins <2. # verified 2026-08-29 against the 3.6.0 sdist PKG-INFO. RDEPEND=" >=dev-python/anyio-4.10.0[${PYTHON_USEDEP}] =dev-python/httpx2-2.7.0[${PYTHON_USEDEP}] =dev-python/jiter-0.16.0[${PYTHON_USEDEP}] =dev-python/pydantic-1.10.13[${PYTHON_USEDEP}] =dev-python/typing-extensions-4.14[${PYTHON_USEDEP}] =22.4,<26 and the hook.) verified 2026-08-29 against # the 3.6.0 sdist pyproject.toml. # Tests need the same Stainless mock-server stack as anthropic. RESTRICT="test"