From 4e3ec32c2336739b75a0f9bc43b33e0f1cbbd717 Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Thu, 17 Jul 2025 02:58:50 +0000 Subject: Adding metadata --- .../files/respx-0.22.0-tests-flexibility.patch | 98 ---------------------- dev-python/respx/respx-0.22.0-r1.ebuild | 44 ++++++++++ dev-python/respx/respx-0.22.0-r2.ebuild | 48 ----------- 3 files changed, 44 insertions(+), 146 deletions(-) delete mode 100644 dev-python/respx/files/respx-0.22.0-tests-flexibility.patch create mode 100644 dev-python/respx/respx-0.22.0-r1.ebuild delete mode 100644 dev-python/respx/respx-0.22.0-r2.ebuild (limited to 'dev-python/respx') diff --git a/dev-python/respx/files/respx-0.22.0-tests-flexibility.patch b/dev-python/respx/files/respx-0.22.0-tests-flexibility.patch deleted file mode 100644 index ea9e6cd20252..000000000000 --- a/dev-python/respx/files/respx-0.22.0-tests-flexibility.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 92925950090c28124d191f81f0f0c6a742e6b136 Mon Sep 17 00:00:00 2001 -From: Eli Schwartz -Date: Tue, 8 Jul 2025 00:21:38 -0400 -Subject: [PATCH] tests: support any httpx version - -Signed-off-by: Eli Schwartz ---- - noxfile.py | 2 +- - tests/test_api.py | 23 ++++++++++++++++++----- - 2 files changed, 19 insertions(+), 6 deletions(-) - -diff --git a/noxfile.py b/noxfile.py -index 39fbef4..40fe124 100644 ---- a/noxfile.py -+++ b/noxfile.py -@@ -7,7 +7,7 @@ nox.options.keywords = "test + mypy" - - @nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]) - def test(session): -- deps = ["pytest", "pytest-asyncio", "pytest-cov", "trio", "starlette", "flask"] -+ deps = ["pytest", "pytest-asyncio", "pytest-cov", "trio", "starlette", "flask", "packaging"] - session.install("--upgrade", *deps) - session.install("-e", ".") - -diff --git a/tests/test_api.py b/tests/test_api.py -index 81ca4b2..170389b 100644 ---- a/tests/test_api.py -+++ b/tests/test_api.py -@@ -7,12 +7,15 @@ from unittest import mock - import httpcore - import httpx - import pytest -+from packaging.version import Version - - import respx - from respx.models import Route - from respx.patterns import M - from respx.router import MockRouter - -+httpx_0_28 = Version(httpx.__version__) >= Version('0.28') -+ - - async def test_http_methods(client): - async with respx.mock: -@@ -214,7 +217,7 @@ async def test_content_variants(client, key, value, expected_content_type): - {"X-Foo": "bar"}, - { - "Content-Type": "application/json", -- "Content-Length": "13", -+ "Content-Length": "13" if httpx_0_28 else "14", - "X-Foo": "bar", - }, - ), -@@ -223,7 +226,7 @@ async def test_content_variants(client, key, value, expected_content_type): - {"Content-Type": "application/json; charset=utf-8", "X-Foo": "bar"}, - { - "Content-Type": "application/json; charset=utf-8", -- "Content-Length": "13", -+ "Content-Length": "13" if httpx_0_28 else "14", - "X-Foo": "bar", - }, - ), -@@ -322,19 +325,29 @@ async def test_callable_content(client): - assert request.called is True - assert async_response.status_code == 200 - assert async_response.text == "hello world." -- assert request.calls[-1][0].content == b'{"x":"."}' -+ if httpx_0_28: -+ assert request.calls[-1][0].content == b'{"x":"."}' -+ else: -+ assert request.calls[-1][0].content == b'{"x": "."}' - - respx_mock.reset() - sync_response = httpx.post("https://foo.bar/jonas/", json={"x": "!"}) - assert request.called is True - assert sync_response.status_code == 200 - assert sync_response.text == "hello jonas!" -- assert request.calls[-1][0].content == b'{"x":"!"}' -+ if httpx_0_28: -+ assert request.calls[-1][0].content == b'{"x":"!"}' -+ else: -+ assert request.calls[-1][0].content == b'{"x": "!"}' - - - async def test_request_callback(client): - def callback(request, name): -- if request.url.host == "foo.bar" and request.content == b'{"foo":"bar"}': -+ if httpx_0_28: -+ content = b'{"foo":"bar"}' -+ else: -+ content = b'{"foo": "bar"}' -+ if request.url.host == "foo.bar" and request.content == content: - return respx.MockResponse( - 202, - headers={"X-Foo": "bar"}, --- -2.49.0 - diff --git a/dev-python/respx/respx-0.22.0-r1.ebuild b/dev-python/respx/respx-0.22.0-r1.ebuild new file mode 100644 index 000000000000..decde3e63df0 --- /dev/null +++ b/dev-python/respx/respx-0.22.0-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 2024-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{11..14} ) + +inherit distutils-r1 + +DESCRIPTION="Mock HTTPX with awesome request patterns and response side effects" +HOMEPAGE=" + https://lundberg.github.io/respx/ + https://pypi.org/project/respx/ + https://github.com/lundberg/respx/ +" +# no tests in pypi sdist +SRC_URI=" + https://github.com/lundberg/respx/archive/refs/tags/${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 arm64 x86" + +RDEPEND=" + >=dev-python/httpx-0.28.0[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/flask[${PYTHON_USEDEP}] + dev-python/httpcore[${PYTHON_USEDEP}] + dev-python/pytest-asyncio[${PYTHON_USEDEP}] + dev-python/starlette[${PYTHON_USEDEP}] + dev-python/trio[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +python_test() { + epytest -p 'no:*' -p asyncio -o addopts= +} diff --git a/dev-python/respx/respx-0.22.0-r2.ebuild b/dev-python/respx/respx-0.22.0-r2.ebuild deleted file mode 100644 index 84b80eb2e270..000000000000 --- a/dev-python/respx/respx-0.22.0-r2.ebuild +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2024-2025 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{11..14} ) - -inherit distutils-r1 - -DESCRIPTION="Mock HTTPX with awesome request patterns and response side effects" -HOMEPAGE=" - https://lundberg.github.io/respx/ - https://pypi.org/project/respx/ - https://github.com/lundberg/respx/ -" -# no tests in pypi sdist -SRC_URI=" - https://github.com/lundberg/respx/archive/refs/tags/${PV}.tar.gz - -> ${P}.gh.tar.gz -" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 arm64 x86" - -RDEPEND=" - >=dev-python/httpx-0.25.0[${PYTHON_USEDEP}] -" -BDEPEND=" - test? ( - dev-python/flask[${PYTHON_USEDEP}] - dev-python/httpcore[${PYTHON_USEDEP}] - dev-python/pytest-asyncio[${PYTHON_USEDEP}] - dev-python/starlette[${PYTHON_USEDEP}] - dev-python/trio[${PYTHON_USEDEP}] - ) -" - -PATCHES=( - "${FILESDIR}"/${PN}-0.22.0-tests-flexibility.patch -) - -distutils_enable_tests pytest - -python_test() { - epytest -p 'no:*' -p asyncio -o addopts= -} -- cgit v1.3