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