From 0f558761aa2dee1017b4751e4017205e015a9560 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 29 Jun 2022 12:04:12 +0100 Subject: gentoo resync : 29.12.2022 --- dev-python/httpretty/Manifest | 3 +- .../httpretty/files/httpretty-1.1.4-pytest.patch | 121 +++++++++++++++++++++ dev-python/httpretty/httpretty-1.1.4-r1.ebuild | 81 ++++++++++++++ dev-python/httpretty/httpretty-1.1.4.ebuild | 42 ------- 4 files changed, 204 insertions(+), 43 deletions(-) create mode 100644 dev-python/httpretty/files/httpretty-1.1.4-pytest.patch create mode 100644 dev-python/httpretty/httpretty-1.1.4-r1.ebuild delete mode 100644 dev-python/httpretty/httpretty-1.1.4.ebuild (limited to 'dev-python/httpretty') diff --git a/dev-python/httpretty/Manifest b/dev-python/httpretty/Manifest index 46ae0cbfb662..a0214f59c515 100644 --- a/dev-python/httpretty/Manifest +++ b/dev-python/httpretty/Manifest @@ -1,3 +1,4 @@ +AUX httpretty-1.1.4-pytest.patch 4970 BLAKE2B 396fd081c958616978b0f0fa476a0b6b1f3e530aee5bddc969fcd0b9471e094dfb7c2114940f86dea6e50222f4224321cf7ed449999c61eb7006c9d1cff3e7e6 SHA512 f9064a67d852a026a7398fc1593499d4d3c7e44d00d01d1ecb68d813b1114578858a2b2d11f56f44ce7284b618143098c590fef442c118f532b29503f135ab55 DIST httpretty-1.1.4.tar.gz 442389 BLAKE2B 020a9fd2b5dc9790b53009caac37a3cf5a0e47102b9be05f4df255880f5daf5e7689714e0c0a8f223155d191c471cb5ff4f9b0d0d34b07bd5f377311ed56ba25 SHA512 4daceea4f30ce181e871167d304bd7af9d504364f55d42f8025770f2efe7e833d018aed681c8733d653d4de90db3433e999c56bccd4675f81e66d1cc4023e418 -EBUILD httpretty-1.1.4.ebuild 1169 BLAKE2B 24e27504292721d4a1e35b3c0f22789b2b201017ec81c5b43b659bcafed8a37f25037297715c702bfdb7dc71fe80315e0fb407229934251850eab2724c7271f8 SHA512 75887d111ec82c4ac978efaf3c0ba1f07c0d6ad7b1ed1bee209ea8016e67f975d2fe543eb2ad0b64e9931b59843d643a83c403859bddf342ee0c2ceb6b9254e9 +EBUILD httpretty-1.1.4-r1.ebuild 2108 BLAKE2B 539bf5ed92f4e182f13891346b51610b645b3595607a6511da6cd3755cf7722206b9c2eadea79c219bd7da2b6922282d4d75d08bd4f0fb6a309168da6060b5b2 SHA512 88633454d2c27e50b43226ab59e092cce50a8cd9bc395739b904d92f228ee446a4ebe610b893ae3325e0ee8c1877cf5398760aef0ee47e76ab6cc57c106a3d3c MISC metadata.xml 616 BLAKE2B 65eeaf117de44f4d836a207f29728912c57ea62ca6102334ab183beb5e48e4f9fe683b3356f39a8456e3981e7c9470f312d516f47a2b14b6c08befdbd777a778 SHA512 2ba0ba780ad8dba7c193d0c10eb4b993f93c8ca0e4c99d22a70d3bf86588e9b9df20f560a91edbaa72a95beead383386dfc96ae16299ef03936257d4e03a4b77 diff --git a/dev-python/httpretty/files/httpretty-1.1.4-pytest.patch b/dev-python/httpretty/files/httpretty-1.1.4-pytest.patch new file mode 100644 index 000000000000..ccb465ce98ea --- /dev/null +++ b/dev-python/httpretty/files/httpretty-1.1.4-pytest.patch @@ -0,0 +1,121 @@ +From 299d50c9cb0ba73343d1a88c202e17f6599fde54 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sat, 14 May 2022 13:39:13 +0200 +Subject: [PATCH] Fix functional tests compatibility with pytest + +Provide a default value for test parameters provided by decorators +in order to prevent pytest from recognizing them as fixtures. This +is the smaller change needed to run the complete test suite via pytest. + +Fixes #449 +--- + tests/functional/test_bypass.py | 8 ++++---- + tests/functional/test_debug.py | 10 +++++----- + tests/functional/test_requests.py | 2 +- + 3 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/tests/functional/test_bypass.py b/tests/functional/test_bypass.py +index e85dfac..cf7e75d 100644 +--- a/tests/functional/test_bypass.py ++++ b/tests/functional/test_bypass.py +@@ -88,7 +88,7 @@ def stop_tcp_server(context): + + @httpretty.activate + @that_with_context(start_http_server, stop_http_server) +-def test_httpretty_bypasses_when_disabled(context): ++def test_httpretty_bypasses_when_disabled(context=None): + "httpretty should bypass all requests by disabling it" + + httpretty.register_uri( +@@ -122,7 +122,7 @@ def test_httpretty_bypasses_when_disabled(context): + + @httpretty.activate(verbose=True) + @that_with_context(start_http_server, stop_http_server) +-def test_httpretty_bypasses_a_unregistered_request(context): ++def test_httpretty_bypasses_a_unregistered_request(context=None): + "httpretty should bypass a unregistered request by disabling it" + + httpretty.register_uri( +@@ -145,7 +145,7 @@ def test_httpretty_bypasses_a_unregistered_request(context): + + @httpretty.activate(verbose=True) + @that_with_context(start_tcp_server, stop_tcp_server) +-def test_using_httpretty_with_other_tcp_protocols(context): ++def test_using_httpretty_with_other_tcp_protocols(context=None): + "httpretty should work even when testing code that also use other TCP-based protocols" + + httpretty.register_uri( +@@ -163,7 +163,7 @@ def test_using_httpretty_with_other_tcp_protocols(context): + + @httpretty.activate(allow_net_connect=False) + @that_with_context(start_http_server, stop_http_server) +-def test_disallow_net_connect_1(context, verbose=True): ++def test_disallow_net_connect_1(context=None, verbose=True): + """ + When allow_net_connect = False, a request that otherwise + would have worked results in UnmockedError. +diff --git a/tests/functional/test_debug.py b/tests/functional/test_debug.py +index 86bf09e..ee742f3 100644 +--- a/tests/functional/test_debug.py ++++ b/tests/functional/test_debug.py +@@ -39,7 +39,7 @@ def create_socket(context): + @skip('not currently supported') + @httprettified + @scenario(create_socket) +-def test_httpretty_debugs_socket_send(context): ++def test_httpretty_debugs_socket_send(context=None): + "HTTPretty should forward_and_trace socket.send" + + expect(context.sock.send).when.called_with(b'data').to.throw( +@@ -50,7 +50,7 @@ def test_httpretty_debugs_socket_send(context): + @skip('not currently supported') + @httprettified + @scenario(create_socket) +-def test_httpretty_debugs_socket_sendto(context): ++def test_httpretty_debugs_socket_sendto(context=None): + "HTTPretty should forward_and_trace socket.sendto" + + expect(context.sock.sendto).when.called.to.throw( +@@ -61,7 +61,7 @@ def test_httpretty_debugs_socket_sendto(context): + @skip('not currently supported') + @httprettified + @scenario(create_socket) +-def test_httpretty_debugs_socket_recvfrom(context): ++def test_httpretty_debugs_socket_recvfrom(context=None): + "HTTPretty should forward_and_trace socket.recvfrom" + + expect(context.sock.recvfrom).when.called.to.throw( +@@ -72,7 +72,7 @@ def test_httpretty_debugs_socket_recvfrom(context): + @skip('not currently supported') + @httprettified + @scenario(create_socket) +-def test_httpretty_debugs_socket_recv_into(context): ++def test_httpretty_debugs_socket_recv_into(context=None): + "HTTPretty should forward_and_trace socket.recv_into" + buf = bytearray() + expect(context.sock.recv_into).when.called_with(buf).to.throw( +@@ -83,7 +83,7 @@ def test_httpretty_debugs_socket_recv_into(context): + @skip('not currently supported') + @httprettified + @scenario(create_socket) +-def test_httpretty_debugs_socket_recvfrom_into(context): ++def test_httpretty_debugs_socket_recvfrom_into(context=None): + "HTTPretty should forward_and_trace socket.recvfrom_into" + + expect(context.sock.recvfrom_into).when.called.to.throw( +diff --git a/tests/functional/test_requests.py b/tests/functional/test_requests.py +index 55aa109..04a5e80 100644 +--- a/tests/functional/test_requests.py ++++ b/tests/functional/test_requests.py +@@ -768,7 +768,7 @@ def test_unicode_querystrings(): + + + @use_tornado_server +-def test_recording_calls(port): ++def test_recording_calls(port=None): + ("HTTPretty should be able to record calls") + # Given a destination path: + destination = FIXTURE_FILE("recording-1.json") +-- +2.35.1 + diff --git a/dev-python/httpretty/httpretty-1.1.4-r1.ebuild b/dev-python/httpretty/httpretty-1.1.4-r1.ebuild new file mode 100644 index 000000000000..95b5b255ea26 --- /dev/null +++ b/dev-python/httpretty/httpretty-1.1.4-r1.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..11} ) + +inherit distutils-r1 + +DESCRIPTION="HTTP client mock for Python" +HOMEPAGE=" + https://github.com/gabrielfalcao/httpretty/ + https://pypi.org/project/httpretty/ +" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +SLOT="0" +LICENSE="MIT" +KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86" + +RDEPEND=" + dev-python/urllib3[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/freezegun[${PYTHON_USEDEP}] + >=dev-python/requests-1.1[${PYTHON_USEDEP}] + dev-python/sure[${PYTHON_USEDEP}] + >=www-servers/tornado-2.2[${PYTHON_USEDEP}] + ) +" +# These are optional test deps, that are used to test compatibility +# with various HTTP libs. We prefer pulling them in whenever possible +# to increase test coverage but we can live without them. +# We're skipping redis entirely since it requires a running server. +BDEPEND+=" + test? ( + dev-python/pyopenssl[${PYTHON_USEDEP}] + $(python_gen_cond_dep ' + >=dev-python/boto3-1.17.72[${PYTHON_USEDEP}] + dev-python/httplib2[${PYTHON_USEDEP}] + >=dev-python/httpx-0.18.1[${PYTHON_USEDEP}] + ' python3_{8..11}) + $(python_gen_cond_dep ' + >=dev-python/eventlet-0.25.1[${PYTHON_USEDEP}] + ' python3_{8..9}) + ) +" + +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}/${P}-pytest.patch" +) + +python_test() { + local EPYTEST_IGNORE=( + # this seems to be a stress test + tests/bugfixes/pytest/test_426_mypy_segfault.py + # passthrough tests require Internet access + tests/functional/test_passthrough.py + ) + + local ignore_by_dep=( + dev-python/boto3:tests/bugfixes/nosetests/test_416_boto3.py + dev-python/eventlet:tests/bugfixes/nosetests/test_eventlet.py + dev-python/httplib2:tests/functional/test_httplib2.py + dev-python/httpx:tests/bugfixes/nosetests/test_414_httpx.py + dev-python/pyopenssl:tests/bugfixes/nosetests/test_417_openssl.py + ) + + local x + for x in "${ignore_by_dep[@]}"; do + if ! has_version "${x%:*}[${PYTHON_USEDEP}]"; then + EPYTEST_IGNORE+=( "${x#*:}" ) + fi + done + + epytest +} diff --git a/dev-python/httpretty/httpretty-1.1.4.ebuild b/dev-python/httpretty/httpretty-1.1.4.ebuild deleted file mode 100644 index ebb43b2a8e5d..000000000000 --- a/dev-python/httpretty/httpretty-1.1.4.ebuild +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..10} ) -inherit distutils-r1 - -DESCRIPTION="HTTP client mock for Python" -HOMEPAGE="https://github.com/gabrielfalcao/httpretty" -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" - -SLOT="0" -LICENSE="MIT" -KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86" - -RDEPEND=" - dev-python/urllib3[${PYTHON_USEDEP}]" -# eventlet is used only to test compat, and it doesn't support py3.10 -# redis skipped as it requires a redis server running -BDEPEND=" - test? ( - >=dev-python/boto3-1.17.72[${PYTHON_USEDEP}] - dev-python/freezegun[${PYTHON_USEDEP}] - dev-python/httplib2[${PYTHON_USEDEP}] - >=dev-python/httpx-0.18.1[${PYTHON_USEDEP}] - dev-python/pyopenssl[${PYTHON_USEDEP}] - >=dev-python/requests-1.1[${PYTHON_USEDEP}] - dev-python/sure[${PYTHON_USEDEP}] - >=www-servers/tornado-2.2[${PYTHON_USEDEP}] -)" - -distutils_enable_tests nose - -python_prepare_all() { - # remove useless deps - sed -i -e '/rednose/d' setup.cfg || die - # tests requiring network access - rm tests/functional/test_passthrough.py || die - - distutils-r1_python_prepare_all -} -- cgit v1.2.3