diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-05-15 19:43:06 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-05-15 19:53:55 +0200 |
commit | a817b977fe91b3202ef9bc3272a6e552a66ec3e8 (patch) | |
tree | 0439804f19f0ae621294c4a6e08feaf7dfef7ac5 /dev-python/httpx | |
parent | app-emulation/virtualbox-kvm: drop 7.0.14_pre20240325 (diff) | |
download | gentoo-a817b977fe91b3202ef9bc3272a6e552a66ec3e8.tar.gz gentoo-a817b977fe91b3202ef9bc3272a6e552a66ec3e8.tar.bz2 gentoo-a817b977fe91b3202ef9bc3272a6e552a66ec3e8.zip |
dev-python/httpx: Enable py3.13
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/httpx')
-rw-r--r-- | dev-python/httpx/files/httpx-0.27.0-opt-trio.patch | 17 | ||||
-rw-r--r-- | dev-python/httpx/httpx-0.27.0.ebuild | 17 |
2 files changed, 31 insertions, 3 deletions
diff --git a/dev-python/httpx/files/httpx-0.27.0-opt-trio.patch b/dev-python/httpx/files/httpx-0.27.0-opt-trio.patch new file mode 100644 index 000000000000..6c2c9e67255f --- /dev/null +++ b/dev-python/httpx/files/httpx-0.27.0-opt-trio.patch @@ -0,0 +1,17 @@ +diff --git a/tests/concurrency.py b/tests/concurrency.py +index a8ed558..d5ce803 100644 +--- a/tests/concurrency.py ++++ b/tests/concurrency.py +@@ -5,11 +5,11 @@ Async environment-agnostic concurrency utilities that are only used in tests. + import asyncio + + import sniffio +-import trio + + + async def sleep(seconds: float) -> None: + if sniffio.current_async_library() == "trio": ++ import trio + await trio.sleep(seconds) # pragma: no cover + else: + await asyncio.sleep(seconds) diff --git a/dev-python/httpx/httpx-0.27.0.ebuild b/dev-python/httpx/httpx-0.27.0.ebuild index 108c55923dff..0a648891634c 100644 --- a/dev-python/httpx/httpx-0.27.0.ebuild +++ b/dev-python/httpx/httpx-0.27.0.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=hatchling -PYTHON_COMPAT=( pypy3 python3_{10..12} ) +PYTHON_COMPAT=( pypy3 python3_{10..13} ) inherit distutils-r1 optfeature @@ -44,16 +44,22 @@ BDEPEND=" dev-python/cryptography[${PYTHON_USEDEP}] dev-python/h2[${PYTHON_USEDEP}] dev-python/socksio[${PYTHON_USEDEP}] - dev-python/trio[${PYTHON_USEDEP}] dev-python/trustme[${PYTHON_USEDEP}] dev-python/typing-extensions[${PYTHON_USEDEP}] dev-python/uvicorn[${PYTHON_USEDEP}] + $(python_gen_cond_dep ' + dev-python/trio[${PYTHON_USEDEP}] + ' 3.{10..12}) ) " distutils_enable_tests pytest src_prepare() { + local PATCHES=( + "${FILESDIR}/${P}-opt-trio.patch" + ) + if ! use cli; then sed -i -e '/^httpx =/d' pyproject.toml || die fi @@ -63,6 +69,7 @@ src_prepare() { } python_test() { + local args=() local EPYTEST_DESELECT=( # Internet tests/client/test_proxies.py::test_async_proxy_close @@ -73,7 +80,11 @@ python_test() { tests/test_main.py ) - epytest + if ! has_version "dev-python/trio[${PYTHON_USEDEP}]"; then + args+=( -o filterwarnings= -k "not trio" ) + fi + + epytest "${args[@]}" } pkg_postinst() { |