File support-new-httpx.patch of Package python-softlayer-zeep

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",
openSUSE Build Service is sponsored by