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.
This commit is contained in:
Miro Hrončok 2023-10-09 19:49:30 +02:00
parent 85ab608837
commit 04a972bc7a

View File

@ -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 BRs 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