From 60322ccd89b0fd2c6798b467628f2cec4ea940a7037c9487d85e5616f452468b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 23 May 2024 10:01:38 +0000 Subject: [PATCH] Accepting request 1176158 from home:ojkastl_buildservice:Branch_devel_languages_python - backport patches to fix errors with requests 2.32.x: * 2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch * e33e0a437ecd895158c8cb4322a0cdad79312636.patch OBS-URL: https://build.opensuse.org/request/show/1176158 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docker?expand=0&rev=56 --- ...9a9f19c7b37c6c71c233754c6845e325d1ec.patch | 30 +++++++++++++++++++ ...0a437ecd895158c8cb4322a0cdad79312636.patch | 25 ++++++++++++++++ python-docker.changes | 7 +++++ python-docker.spec | 8 ++++- 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch create mode 100644 e33e0a437ecd895158c8cb4322a0cdad79312636.patch diff --git a/2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch b/2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch new file mode 100644 index 0000000..035b28a --- /dev/null +++ b/2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch @@ -0,0 +1,30 @@ +From 2a059a9f19c7b37c6c71c233754c6845e325d1ec Mon Sep 17 00:00:00 2001 +From: Felix Fontein +Date: Tue, 21 May 2024 18:44:08 +0200 +Subject: [PATCH] Extend fix to requests 2.32.2+. + +Signed-off-by: Felix Fontein +--- + docker/transport/basehttpadapter.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/docker/transport/basehttpadapter.py b/docker/transport/basehttpadapter.py +index 281897a27..c5996bb3e 100644 +--- a/docker/transport/basehttpadapter.py ++++ b/docker/transport/basehttpadapter.py +@@ -7,9 +7,14 @@ def close(self): + if hasattr(self, 'pools'): + self.pools.clear() + +- # Hotfix for requests 2.32.0: its commit ++ # Hotfix for requests 2.32.0 and 2.32.1: its commit + # https://github.com/psf/requests/commit/c0813a2d910ea6b4f8438b91d315b8d181302356 + # changes requests.adapters.HTTPAdapter to no longer call get_connection() from + # send(), but instead call _get_connection(). + def _get_connection(self, request, *args, proxies=None, **kwargs): + return self.get_connection(request.url, proxies) ++ ++ # Fix for requests 2.32.2+: ++ # https://github.com/psf/requests/commit/c98e4d133ef29c46a9b68cd783087218a8075e05 ++ def get_connection_with_tls_context(self, request, verify, proxies=None, cert=None): ++ return self.get_connection(request.url, proxies) diff --git a/e33e0a437ecd895158c8cb4322a0cdad79312636.patch b/e33e0a437ecd895158c8cb4322a0cdad79312636.patch new file mode 100644 index 0000000..cc32449 --- /dev/null +++ b/e33e0a437ecd895158c8cb4322a0cdad79312636.patch @@ -0,0 +1,25 @@ +From e33e0a437ecd895158c8cb4322a0cdad79312636 Mon Sep 17 00:00:00 2001 +From: Felix Fontein +Date: Mon, 20 May 2024 21:13:41 +0200 +Subject: [PATCH] Hotfix for requests 2.32.0. + +Signed-off-by: Felix Fontein +--- + docker/transport/basehttpadapter.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/docker/transport/basehttpadapter.py b/docker/transport/basehttpadapter.py +index dfbb193b9..281897a27 100644 +--- a/docker/transport/basehttpadapter.py ++++ b/docker/transport/basehttpadapter.py +@@ -6,3 +6,10 @@ def close(self): + super().close() + if hasattr(self, 'pools'): + self.pools.clear() ++ ++ # Hotfix for requests 2.32.0: its commit ++ # https://github.com/psf/requests/commit/c0813a2d910ea6b4f8438b91d315b8d181302356 ++ # changes requests.adapters.HTTPAdapter to no longer call get_connection() from ++ # send(), but instead call _get_connection(). ++ def _get_connection(self, request, *args, proxies=None, **kwargs): ++ return self.get_connection(request.url, proxies) diff --git a/python-docker.changes b/python-docker.changes index 0073b11..bdfccf7 100644 --- a/python-docker.changes +++ b/python-docker.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu May 23 08:58:30 UTC 2024 - Johannes Kastl + +- backport patches to fix errors with requests 2.32.x: + * 2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch + * e33e0a437ecd895158c8cb4322a0cdad79312636.patch + ------------------------------------------------------------------- Wed Dec 27 09:30:58 UTC 2023 - Dirk Müller diff --git a/python-docker.spec b/python-docker.spec index 439567c..993bc92 100644 --- a/python-docker.spec +++ b/python-docker.spec @@ -1,7 +1,7 @@ # # spec file for package python-docker # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,6 +24,12 @@ Summary: A Python library for the Docker Engine API License: Apache-2.0 URL: https://github.com/docker/docker-py Source: https://files.pythonhosted.org/packages/source/d/docker/docker-%{version}.tar.gz +# PATCH-FIX-UPSTREAM e33e0a437ecd895158c8cb4322a0cdad79312636.patch -- based on commit e33e0a4 +# https://github.com/docker/docker-py/commit/e33e0a437ecd895158c8cb4322a0cdad79312636.patch +Patch1: e33e0a437ecd895158c8cb4322a0cdad79312636.patch +# PATCH-FIX-UPSTREAM 2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch -- based on commit 2a059a9 +# https://github.com/docker/docker-py/commit/2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch +Patch2: 2a059a9f19c7b37c6c71c233754c6845e325d1ec.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools >= 45} BuildRequires: %{python_module setuptools_scm >= 6.2}