From 04a972bc7a6a690a1009163b161ba97a723b2e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 9 Oct 2023 19:49:30 +0200 Subject: [PATCH] Don't package urllib3[socks] and urrlib3[brotli] on RHEL It appears that pysocks is only in RHEL because of this package. Now went he hardcoded runtime dependency was dropped, we can remove the package from RHEL by not packaging extras here. --- python-urllib3.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python-urllib3.spec b/python-urllib3.spec index 1a072df..1b28ed5 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -1,9 +1,11 @@ # When bootstrapping Python, we cannot test this yet -# RHEL does not include the test dependencies +# RHEL does not include the test dependencies and the dependencies for extras %if 0%{?rhel} %bcond_with tests +%bcond_with extras %else %bcond_without tests +%bcond_without extras %endif Name: python-urllib3 @@ -76,18 +78,22 @@ Requires: %{py3_dist idna} # grep __version__ src/urllib3/packages/six.py Provides: bundled(python3dist(six)) = 1.16.0 +%if %{with extras} # There has historically been a manual hard dependency on python3-pysocks; # since bringing it in is the sole function of python3-urllib3+socks, # we recommend it, so it is installed by default. Recommends: python3-urllib3+socks +%endif %description -n python3-urllib3 %{_description} +%if %{with extras} # We do NOT package the “secure” extra because it is deprecated; see: # “Deprecate the pyOpenSSL TLS implementation and [secure] extra” # https://github.com/urllib3/urllib3/issues/2680 %pyproject_extras_subpkg -n python3-urllib3 brotli socks +%endif %prep @@ -119,7 +125,7 @@ sed -i -e 's/^import mock/from unittest import mock/' \ %generate_buildrequires # Generate BR’s from packaged extras even when tests are disabled, to ensure # the extras metapackages are installable if the build succeeds. -%pyproject_buildrequires -x brotli,socks +%pyproject_buildrequires %{?with_extras:-x brotli,socks} %build