# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=hatchling PYTHON_COMPAT=( python3_{9..12} ) inherit distutils-r1 MY_PN="${PN}-python" MY_P="${MY_PN}-${PV}" DESCRIPTION="The official Python library for the OpenAI API" HOMEPAGE="https://github.com/openai/openai-python" SRC_URI="https://github.com/openai/${MY_PN}/archive/v${PV}.tar.gz -> ${MY_P}.gh.tar.gz" LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64 ~x86" RDEPEND="dev-python/anyio[${PYTHON_USEDEP}] dev-python/distro[${PYTHON_USEDEP}] dev-python/httpx[${PYTHON_USEDEP}] dev-python/pydantic[${PYTHON_USEDEP}] dev-python/sniffio[${PYTHON_USEDEP}] dev-python/tqdm[${PYTHON_USEDEP}] dev-python/typing-extensions[${PYTHON_USEDEP}]" BDEPEND="test? ( dev-python/dirty-equals[${PYTHON_USEDEP}] dev-python/respx[${PYTHON_USEDEP}] dev-python/pytest-asyncio[${PYTHON_USEDEP}] )" S="${WORKDIR}/${MY_P}" distutils_enable_tests pytest EPYTEST_DESELECT=( # need mock server tests/test_client.py::TestAsyncOpenAI::test_retrying_timeout_errors_doesnt_leak tests/test_client.py::TestAsyncOpenAI::test_retrying_status_errors_doesnt_leak tests/test_client.py::TestOpenAI::test_retrying_timeout_errors_doesnt_leak tests/test_client.py::TestOpenAI::test_retrying_status_errors_doesnt_leak ) src_prepare() { default # remove tests need mock server rm -rf tests/api_resources || die "rm failed" }