Stop Recommending setuptools and move the pip Recommendation to python3-devel

With modern pip, setuptools is not required on runtime.
Python packages use PEP 517 instead.

Hence, we no longer Recommend setuptools and pip, but pip only.

Users who are impacted may see one of:

    ModuleNotFoundError: No module named 'setuptools'
    ModuleNotFoundError: No module named 'pkg_resoureces'

They can easily recover by installing python3-setuptools or python3-pkg_resources.

Related but not explicitly part of:
https://fedoraproject.org/wiki/Changes/Reduce_dependencies_on_python3-setuptools

Together with this change, we move the pip Recommendation to the python3-devel package.
"Regular users" of Fedora and RHEL are less likely to need pip and more likely to brick
their systems with it. If they need pip, they can dnf install pip.

Pip (incl. setuptools) still works in environments created with venv or virtualenv.

Resolves: rhbz#1947857
This commit is contained in:
Miro Hrončok 2021-04-23 12:57:43 +02:00 committed by Charalampos Stratakis
parent 24e9be4681
commit 67b133f25b

View File

@ -17,7 +17,7 @@ URL: https://www.python.org/
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 3%{?dist}
Release: 4%{?dist}
License: Python
@ -451,12 +451,6 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
# but file provides aren't versioned and the file moved across packages.
# Instead, we rely on the conflict in python3-libs.
# Previously, this was required for our rewheel patch to work.
# This is technically no longer needed, but we keep it recommended
# for the developer experience.
Recommends: %{pkgname}-setuptools
Recommends: %{pkgname}-pip
# This prevents ALL subpackages built from this spec to require
# /usr/bin/python3* or python(abi). Granularity per subpackage is impossible.
# It's intended for the libs package not to drag in the interpreter, see
@ -557,6 +551,9 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
Requires: (python-rpm-macros if rpm-build)
Requires: (python3-rpm-macros if rpm-build)
# Python developers are very likely to need pip
Recommends: %{pkgname}-pip
%if %{without bootstrap}
# This is not "API" (packages that need setuptools should still BuildRequire it)
# However some packages apparently can build both with and without setuptools
@ -1756,6 +1753,10 @@ CheckPython optimized
# ======================================================
%changelog
* Thu Jun 03 2021 Charalampos Stratakis <cstratak@redhat.com> - 3.9.5-4
- Stop Recommending setuptools and move the pip Recommendation to python3-devel
Resolves: rhbz#1947857
* Tue May 04 2021 Tomas Hrnciar <thrnciar@redhat.com> - 3.9.5-1
- Update to 3.9.5