From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1520213-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1497F158003 for <garchives@archives.gentoo.org>; Sun, 21 May 2023 04:59:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 49E8EE088A; Sun, 21 May 2023 04:59:46 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2C25DE088A for <gentoo-commits@lists.gentoo.org>; Sun, 21 May 2023 04:59:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 39584340D83 for <gentoo-commits@lists.gentoo.org>; Sun, 21 May 2023 04:59:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9DE16A88 for <gentoo-commits@lists.gentoo.org>; Sun, 21 May 2023 04:59:41 +0000 (UTC) From: "Michał Górny" <mgorny@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org> Message-ID: <1684644924.77ab25ab03fa3d51d94cd5a48a6a6f30a1205391.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/requests-unixsocket/files/, dev-python/requests-unixsocket/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/requests-unixsocket/files/requests-unixsocket-0.3.0-urllib3-2.patch dev-python/requests-unixsocket/requests-unixsocket-0.3.0-r4.ebuild X-VCS-Directories: dev-python/requests-unixsocket/files/ dev-python/requests-unixsocket/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 77ab25ab03fa3d51d94cd5a48a6a6f30a1205391 X-VCS-Branch: master Date: Sun, 21 May 2023 04:59:41 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 923cfa94-6b2d-4d80-8289-3d049bbb60c5 X-Archives-Hash: 500ddb6a4042957a6518e4bd4b369da2 commit: 77ab25ab03fa3d51d94cd5a48a6a6f30a1205391 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Sun May 21 04:32:26 2023 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sun May 21 04:55:24 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77ab25ab dev-python/requests-unixsocket: Fix urllib3-2.0* compatibility Pull-Request: https://github.com/msabramo/requests-unixsocket/pull/69 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> .../requests-unixsocket-0.3.0-urllib3-2.patch | 45 ++++++++++++++++++++++ .../requests-unixsocket-0.3.0-r4.ebuild | 38 ++++++++++++++++++ 2 files changed, 83 insertions(+) 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-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