summaryrefslogtreecommitdiff
path: root/dev-python/httpretty
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2026-04-17 19:13:38 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2026-04-17 19:13:38 +0000
commitc8dcb274f379713bdd93a32b91c9c3e5310ea5c8 (patch)
tree8d6725af04672951d3f39c188441a4127f4c4d3f /dev-python/httpretty
parentca125481edd74de829bb375eebaa362b99ad85ca (diff)
downloadbaldeagleos-repo-c8dcb274f379713bdd93a32b91c9c3e5310ea5c8.tar.gz
baldeagleos-repo-c8dcb274f379713bdd93a32b91c9c3e5310ea5c8.tar.xz
baldeagleos-repo-c8dcb274f379713bdd93a32b91c9c3e5310ea5c8.zip
Adding metadata
Diffstat (limited to 'dev-python/httpretty')
-rw-r--r--dev-python/httpretty/files/httpretty-1.1.4-py314.patch41
-rw-r--r--dev-python/httpretty/httpretty-1.1.4-r4.ebuild89
2 files changed, 130 insertions, 0 deletions
diff --git a/dev-python/httpretty/files/httpretty-1.1.4-py314.patch b/dev-python/httpretty/files/httpretty-1.1.4-py314.patch
new file mode 100644
index 000000000000..43513c0bd044
--- /dev/null
+++ b/dev-python/httpretty/files/httpretty-1.1.4-py314.patch
@@ -0,0 +1,41 @@
+From 8d10219036ab18462c0a8e35a5aae80e0d284c57 Mon Sep 17 00:00:00 2001
+From: Steve Kowalik <steven@wedontsleep.org>
+Date: Fri, 10 Apr 2026 11:36:31 +1000
+Subject: [PATCH] Support Python 3.14 partial() changes
+
+functools.partial() was changed in Python 3.14 to be a method
+descriptor, which means we need to wrap it in staticmethod now. This
+change does appear to be backward compatible, so I haven't guarded it
+with a version check.
+---
+ httpretty/core.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/httpretty/core.py b/httpretty/core.py
+index 69686458..2cea6a89 100644
+--- a/httpretty/core.py
++++ b/httpretty/core.py
+@@ -1852,7 +1852,7 @@ def apply_patch_socket():
+ extract_into_urllib3()
+
+ if requests_urllib3_connection is not None:
+- urllib3_wrap = partial(fake_wrap_socket, old_requests_ssl_wrap_socket)
++ urllib3_wrap = staticmethod(partial(fake_wrap_socket, old_requests_ssl_wrap_socket))
+ requests_urllib3_connection.ssl_wrap_socket = urllib3_wrap
+ requests_urllib3_connection.__dict__['ssl_wrap_socket'] = urllib3_wrap
+
+@@ -1867,12 +1867,12 @@ def apply_patch_socket():
+ socks.__dict__['socksocket'] = fakesock.socket
+
+ if ssl:
+- new_wrap = partial(fake_wrap_socket, old_ssl_wrap_socket)
++ new_wrap = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket))
+ ssl.wrap_socket = new_wrap
+ ssl.SSLSocket = FakeSSLSocket
+ ssl.SSLContext = old_sslcontext_class
+ try:
+- ssl.SSLContext.wrap_socket = partial(fake_wrap_socket, old_ssl_wrap_socket)
++ ssl.SSLContext.wrap_socket = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket))
+ except AttributeError:
+ pass
+
diff --git a/dev-python/httpretty/httpretty-1.1.4-r4.ebuild b/dev-python/httpretty/httpretty-1.1.4-r4.ebuild
new file mode 100644
index 000000000000..db9aef003b62
--- /dev/null
+++ b/dev-python/httpretty/httpretty-1.1.4-r4.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..14} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="HTTP client mock for Python"
+HOMEPAGE="
+ https://github.com/gabrielfalcao/httpretty/
+ https://pypi.org/project/httpretty/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="test-rust"
+
+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}]
+ >=dev-python/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? (
+ test-rust? (
+ dev-python/pyopenssl[${PYTHON_USEDEP}]
+ )
+ >=dev-python/boto3-1.17.72[${PYTHON_USEDEP}]
+ dev-python/httplib2[${PYTHON_USEDEP}]
+ >=dev-python/httpx-0.18.1[${PYTHON_USEDEP}]
+ )
+"
+
+EPYTEST_PLUGINS=( pytest-httpx )
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}/${P}-pytest.patch"
+ # https://github.com/gabrielfalcao/HTTPretty/pull/485
+ "${FILESDIR}/${P}-urllib3-2.3.patch"
+ # https://github.com/gabrielfalcao/HTTPretty/pull/488
+ "${FILESDIR}/${P}-py314.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
+ # eventlet is masked for removal
+ tests/bugfixes/nosetests/test_eventlet.py
+ )
+ local EPYTEST_DESELECT=(
+ # regressions with newer dev-python/requests
+ tests/functional/test_requests.py::test_httpretty_should_allow_registering_regexes_with_streaming_responses
+ tests/functional/test_requests.py::test_httpretty_should_handle_paths_starting_with_two_slashes
+ )
+
+ local ignore_by_dep=(
+ dev-python/boto3:tests/bugfixes/nosetests/test_416_boto3.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
+}