summaryrefslogtreecommitdiff
path: root/dev-python/requests-unixsocket
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/requests-unixsocket')
-rw-r--r--dev-python/requests-unixsocket/Manifest4
-rw-r--r--dev-python/requests-unixsocket/files/requests-unixsocket-0.3.0-urllib3-2.patch45
-rw-r--r--dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r3.ebuild (renamed from dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r2.ebuild)1
-rw-r--r--dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r4.ebuild38
4 files changed, 87 insertions, 1 deletions
diff --git a/dev-python/requests-unixsocket/Manifest b/dev-python/requests-unixsocket/Manifest
index 7f2cb479e1ae..ca65ce981e8d 100644
--- a/dev-python/requests-unixsocket/Manifest
+++ b/dev-python/requests-unixsocket/Manifest
@@ -1,3 +1,5 @@
+AUX requests-unixsocket-0.3.0-urllib3-2.patch 1696 BLAKE2B ff96b72329bf0465c6942058c5e339ff94a72f00d4a01d7b4445fd7b4ae81d3f6b53ffe947585a08a290578413c1d85bc0b8c8ca2dafa329a655365484320d01 SHA512 d8e02ab9e8d32c0d1de92d58575b3fc910da1546a76241c828862164b006b693220047a6d0dc4382cce04ed60acd7a5a05d13ea7b833345a0779391da6b032c2
DIST requests-unixsocket-0.3.0.tar.gz 14478 BLAKE2B 5b46ea051729326498f50ba7a952429d271deb102060f8e3019d259ddc21dbffdca8960e140c7ccb25898034cf37fb90dd143c970e75bdc6e6442e9515f14d6e SHA512 21c887b0c3fa526a2debb3960e0ea4dc3b3015cdd517459b6484501176321408d1b4c87dd2840c7d8b71d08fa9114f655ae03f8bc9ff1fca33c914900ef82f5b
-EBUILD requests-unixsocket-0.3.0-r2.ebuild 717 BLAKE2B 2090680f603ca55316d96d2d6a70a2d3450533f7784dd00fc4cb42f61efe88e0c0b5d74363d0fd72a107169a3b21f7f887b702930cc5242be07776195d01d6bb SHA512 cdd6a7bd7a76de8fe4409e03f1ab59fff85bf8aeabada6e2218d20c73b14b1ca9026763d68595b4e6551bfcafbc9609621168ac8f173089a3ce0d9a1102f0a2b
+EBUILD requests-unixsocket-0.3.0-r3.ebuild 758 BLAKE2B d0258197452ac948cce007e44c38c53aca2765512b1635b41ccd8e7f440ce7c58d0b9d3ad7d9db3e6ca6f9c1cea66d47383d7ebb28a73c68be72d209ccf9f873 SHA512 ed84a7e1b4d9db45260be9403775ae4cb85b18fa58fdeeae4610acbca5c1215b4dc34cf7951c5ef0f6be8d50ffc9b743cd4d2c93f62df3c2e58a42b60c3f8d1d
+EBUILD requests-unixsocket-0.3.0-r4.ebuild 871 BLAKE2B 39b89fd1b6a123e2519cc8e6631d0377bb9972f0167face8851d0fb4b5e0e40f8294307a77297b111d280d0d45439fac6cb96eaddae1fa8385665a4be8a08279 SHA512 42e59ee5ba1d4d9d108d9dd22d26dbff71c4d5acc74aaaba10e964522eea6774b20e2c2101167a43ef37b8f7c159405df91e9964e92febd1095a845c82b29733
MISC metadata.xml 325 BLAKE2B 46a5e54f9d40724197835a3b7b096cb8e79a0909ba761c6821256d7fd12994c8d9c6b01510b707ca84cb38ff1b0f62f0293d50c66303860903d785e4e65650d9 SHA512 dee0ea5e9dc5994c5d93a311f98561d2346e8e48aef4871102b8f75e4e40147c187bee52b5106351fd043bed9fc2d32de23038f62c6b90d2b1b4d60ffdc42ac2
diff --git a/dev-python/requests-unixsocket/files/requests-unixsocket-0.3.0-urllib3-2.patch b/dev-python/requests-unixsocket/files/requests-unixsocket-0.3.0-urllib3-2.patch
new file mode 100644
index 000000000000..3cbcd2dd59d3
--- /dev/null
+++ b/dev-python/requests-unixsocket/files/requests-unixsocket-0.3.0-urllib3-2.patch
@@ -0,0 +1,45 @@
+From 5a614f60e7b3639758a6b77691b4e0c0d6827e94 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Roukala=20=28n=C3=A9=20Peres=29?=
+ <martin.roukala@mupuf.org>
+Date: Fri, 5 May 2023 09:23:41 +0300
+Subject: [PATCH] Inherit HTTPConnection through urllib3.connection, not
+ httplib
+
+By inheriting from `urllib3.connection.HTTPConnection` (that inherits
+from `httplib.HTTPConnection` itself), we can adapt to the internal
+changes in urllib3 2.0 that added a `request()` method that is
+incompatible with httplib.HTTPConnection.request.
+
+This fixes the incompatibility between urllib3 2.0 and requests 1.26+,
+which was the first version that stopped vendoring urllib3.
+
+Reference: https://github.com/docker/docker-py/issues/3113#issuecomment-1531570788
+---
+ requests_unixsocket/adapters.py | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/requests_unixsocket/adapters.py b/requests_unixsocket/adapters.py
+index 83e1400..513c243 100644
+--- a/requests_unixsocket/adapters.py
++++ b/requests_unixsocket/adapters.py
+@@ -3,11 +3,6 @@
+ from requests.adapters import HTTPAdapter
+ from requests.compat import urlparse, unquote
+
+-try:
+- import http.client as httplib
+-except ImportError:
+- import httplib
+-
+ try:
+ from requests.packages import urllib3
+ except ImportError:
+@@ -16,7 +11,7 @@
+
+ # The following was adapted from some code from docker-py
+ # https://github.com/docker/docker-py/blob/master/docker/transport/unixconn.py
+-class UnixHTTPConnection(httplib.HTTPConnection, object):
++class UnixHTTPConnection(urllib3.connection.HTTPConnection, object):
+
+ def __init__(self, unix_socket_url, timeout=60):
+ """Create an HTTP connection to a unix domain socket
diff --git a/dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r2.ebuild b/dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r3.ebuild
index 6ad0cb32118f..e0077847ef34 100644
--- a/dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r2.ebuild
+++ b/dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r3.ebuild
@@ -21,6 +21,7 @@ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv
RDEPEND="
dev-python/requests[${PYTHON_USEDEP}]
+ <dev-python/urllib3-2[${PYTHON_USEDEP}]
"
BDEPEND="
dev-python/pbr[${PYTHON_USEDEP}]
diff --git a/dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r4.ebuild b/dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r4.ebuild
new file mode 100644
index 000000000000..e9644e79aedd
--- /dev/null
+++ b/dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r4.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYPI_NO_NORMALIZE=1
+PYTHON_COMPAT=( python3_{9..11} pypy3 )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Use requests to talk HTTP via a UNIX domain socket"
+HOMEPAGE="
+ https://github.com/msabramo/requests-unixsocket/
+ https://pypi.org/project/requests-unixsocket/
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+RDEPEND="
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/urllib3[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ dev-python/pbr[${PYTHON_USEDEP}]
+ test? (
+ dev-python/waitress[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ # https://github.com/msabramo/requests-unixsocket/pull/69
+ "${FILESDIR}/${P}-urllib3-2.patch"
+)
+
+distutils_enable_tests pytest