diff --git a/198.patch b/198.patch new file mode 100644 index 0000000000000000000000000000000000000000..17783092aa21d9ac3390cfb7ef7cfd6744f2e0f1 --- /dev/null +++ b/198.patch @@ -0,0 +1,27 @@ +From fe769c72e4f9d613b2ce066325d2fb28317833d5 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Thu, 18 May 2023 14:09:34 +0200 +Subject: [PATCH] Check for cert_file attribute before accessing it + +In Python 3.12, HTTPSConnection no longer has cert_file attribute +so unless something adds it to the subclass, the attribute doesn't +exist by default. + +CPython change: https://github.com/python/cpython/commit/ef0e72b31d22f780d3a165d7d0471806061fe380#diff-3cf29d90eb758d0fe5ec013bbfda9b0bb60be4f7d899583bd5f490a7a5a5dc5f +--- + distlib/util.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/distlib/util.py b/distlib/util.py +index dd01849..ddfc992 100644 +--- a/distlib/util.py ++++ b/distlib/util.py +@@ -1435,7 +1435,7 @@ def connect(self): + context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + if hasattr(ssl, 'OP_NO_SSLv2'): + context.options |= ssl.OP_NO_SSLv2 +- if self.cert_file: ++ if hasattr(self, "cert_file") and self.cert_file: + context.load_cert_chain(self.cert_file, self.key_file) + kwargs = {} + if self.ca_certs: diff --git a/distlib_unbundle.patch b/distlib_unbundle.patch deleted file mode 100644 index d8dd3469214bf1513bfd6c805ca2e527a3f0d4af..0000000000000000000000000000000000000000 --- a/distlib_unbundle.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/setup.py b/setup.py -index e88d95f..6e1e3df 100644 ---- a/setup.py -+++ b/setup.py -@@ -61,10 +61,6 @@ distutils.core.setup( - packages=[ - 'distlib' - ], -- package_data={ -- 'distlib': ['t32.exe', 't64.exe', 'w32.exe', 'w64.exe', -- 't64-arm.exe', 'w64-arm.exe'], -- }, - cmdclass={ - 'test': TestCommand, - }, diff --git a/python-distlib.spec b/python-distlib.spec index a3710d82d8e479009438ddb4b14e70f470ddf3de..936904a5e777d8ba881dd16331f7a6dfd8769869 100644 --- a/python-distlib.spec +++ b/python-distlib.spec @@ -7,15 +7,16 @@ to reinvent wheels, and improved interoperability between tools.} Summary: Low-level components of distutils2/packaging, augmented with higher-level APIs Name: python-distlib -Version: 0.3.4 -Release: 4%{?dist} +Version: 0.3.6 +Release: 1%{?dist} License: Python URL: https://readthedocs.org/projects/distlib/ -Source0: https://files.pythonhosted.org/packages/source/d/distlib/%{srcname}-%{version}.zip +Source0: %pypi_source %{srcname} %{version} -Patch3000: distlib_unbundle.patch +Patch0001: https://github.com/pypa/distlib/pull/198.patch BuildRequires: python%{python3_pkgversion}-devel pyproject-rpm-macros +BuildRequires: python%{python3_pkgversion}-pytest BuildArch: noarch @@ -32,7 +33,6 @@ Summary: Low-level components of distutils2/packaging, augmented with higher-lev %autosetup -n %{srcname}-%{version} -p1 rm distlib/*.exe -rm -rf distlib/_backport %generate_buildrequires %pyproject_buildrequires @@ -47,13 +47,17 @@ rm -rf distlib/_backport %check export PYTHONHASHSEED=0 export SKIP_ONLINE=1 -%{python3} setup.py test +# https://github.com/pypa/distlib/issues/161 +%pytest -k "not test_sequencer_basic" %files -n python%{python3_pkgversion}-%{srcname} -f %pyproject_files %license LICENSE.txt %doc README.rst %changelog +* Thu Sep 14 2023 Shuo Wang - 0.3.6-1 +- update to 0.3.6 + * Fri Sep 08 2023 OpenCloudOS Release Engineering - 0.3.4-4 - Rebuilt for OpenCloudOS Stream 23.09 diff --git a/sources b/sources index b690e190f85400fa6f07113c7eca56ca733c00e5..ad1e13f0cc3b1b51c8d5d5d90c64d675602ddfc3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (distlib-0.3.4.zip) = 87b5c151517a8043a4d714b561cc0758bd3209b71baf9dcd573a853bd036c54ac2359809b5e2d65cdeee3488757fdc63a2b1abb15e7e189bd601cde1fc85648c +SHA512 (distlib-0.3.6.tar.gz) = 27f3a59f9175a92befb9a65a66cd0b8eb65185dab6fa13ef94e85ca69c2bc1b7281ce1522601034007cb98677ba9237a46224df4adc70ed966db7e131e073636