14
0

Accepting request 1232010 from devel:languages:python

- Add patch support-new-httpx.patch:
  * Support new arguments for httpx 0.28.0+

OBS-URL: https://build.opensuse.org/request/show/1232010
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-softlayer-zeep?expand=0&rev=6
This commit is contained in:
2024-12-19 20:40:50 +00:00
committed by Git OBS Bridge
3 changed files with 73 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Dec 19 06:04:42 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-new-httpx.patch:
* Support new arguments for httpx 0.28.0+
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Nov 14 12:18:00 UTC 2024 - Markéta Machová <mmachova@suse.com> Thu Nov 14 12:18:00 UTC 2024 - Markéta Machová <mmachova@suse.com>

View File

@@ -30,6 +30,8 @@ Source: https://files.pythonhosted.org/packages/source/s/softlayer-zeep/
Patch0: skip-networked-test.patch Patch0: skip-networked-test.patch
# PATCH-FIX-UPSTREAM gh#mvantellingen/python-zeep#d1b0257 Fix regression in parsing xsd:Date with negative timezone # PATCH-FIX-UPSTREAM gh#mvantellingen/python-zeep#d1b0257 Fix regression in parsing xsd:Date with negative timezone
Patch1: xsd-date.patch Patch1: xsd-date.patch
# PATCH-FIX-UPSTREAM Based on gh#mvantellingen/python-zeep#1447
Patch2: support-new-httpx.patch
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes

65
support-new-httpx.patch Normal file
View File

@@ -0,0 +1,65 @@
From 4e2568574271e5e37de5e5c86e4bb12a5e661c6b Mon Sep 17 00:00:00 2001
From: aschollmeier-gcmlp <aschollmeier@gcmlp.com>
Date: Wed, 4 Dec 2024 16:34:22 -0600
Subject: [PATCH 1/3] Update proxy argument in httpx Client/AsyncClient
Ref: https://github.com/encode/httpx/blob/master/CHANGELOG.md#0260-20th-december-2023
---
src/zeep/transports.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: softlayer-zeep-5.0.0/src/zeep/transports.py
===================================================================
--- softlayer-zeep-5.0.0.orig/src/zeep/transports.py
+++ softlayer-zeep-5.0.0/src/zeep/transports.py
@@ -16,6 +16,15 @@ try:
except ImportError:
httpx = None
+try:
+ from packaging.version import Version
+ if httpx is None or Version(httpx.__version__) < Version("0.26.0"):
+ HTTPX_PROXY_KWARG_NAME = "proxies"
+ else:
+ HTTPX_PROXY_KWARG_NAME = "proxy"
+except ImportError:
+ Version = None
+ HTTPX_PROXY_KWARG_NAME = None
__all__ = ["AsyncTransport", "Transport"]
@@ -182,15 +191,16 @@ class AsyncTransport(Transport):
raise RuntimeError("The AsyncTransport is based on the httpx module")
self.cache = cache
+ proxy_kwargs = {HTTPX_PROXY_KWARG_NAME: proxy}
self.wsdl_client = wsdl_client or httpx.Client(
verify=verify_ssl,
- proxies=proxy,
timeout=timeout,
+ **proxy_kwargs,
)
self.client = client or httpx.AsyncClient(
verify=verify_ssl,
- proxies=proxy,
timeout=operation_timeout,
+ **proxy_kwargs,
)
self.logger = logging.getLogger(__name__)
Index: softlayer-zeep-5.0.0/setup.py
===================================================================
--- softlayer-zeep-5.0.0.orig/setup.py
+++ softlayer-zeep-5.0.0/setup.py
@@ -18,7 +18,10 @@ docs_require = [
"sphinx>=1.4.0",
]
-async_require = ["httpx"]
+async_require = [
+ "httpx",
+ "packaging"
+]
xmlsec_require = [
"xmlsec>=0.6.1",