Python Dist RPM provides to only provide PEP503-normalized names
Summary
The legacy python3dist(NAME)
and python3.11dist(NAME)
RPM provides with dots (.
) in NAME
will no longer be automatically provided. NAME
will only be normalized according to PEP 503. E.g. on Fedora 36 a package provides both python3dist(ruamel-yaml)
and python3dist(ruamel.yaml)
, on Fedora 37+ it will only provide python3dist(ruamel-yaml)
(and similarly, python3.11dist(ruamel-yaml)
).
Owner
- Name: Miro Hrončok
- Email: mhroncok@redhat.com
Current status
- Targeted release: Fedora Linux 37
- Last updated: 2022-02-10
- FESCo issue: #2746
- Tracker bug: #2052217
- Release notes tracker: <will NOT be assigned by the Wrangler - not user-facing>
Detailed Description
This change is only about about automatic RPM provides in the following forms:
python3dist(NAME)
python3.Xdist(NAME)
It does not affect any other provides or package names.
Historically, Python package names were normalized by the RPM dependency generators in a way that diverged from upstream behavior. In upstream (e.g. when using pip
) a package name with a dot is equal to a package name with a dash (e.g. pip install ruamel.yaml
and pip install ruamel-yaml
are equivalent). In Fedora, the Provides and Requires included the dot, but upstream rules defined in PEP 503 demand the dot to be replaced by a dash. This caused trouble when other packages required the packages via a name with a dash. Hence, we have slowly been migrating to PEP 503 name normalization.
- Since Fedora 32, Python dependency generators have generated both variants of the Provides as a preparation for the transition to PEP 503-only.
- Since Fedora 33, Python dependency generators have generated Requires in the PEP 503 form (no dots).
- Only packages with manual BuildRequires, Requires, Recommends etc. with requirements such as
python3dist(foo.bar)
would be affected by this change. We have fixed all of them in Fedora 36.
Hence, together with the update to Python3.11, we will disable the legacy form of the provides.
Python packages with dots in their name will only provide the names with dashes.
RHEL/EPEL compatibility
This change is fully compatible with RHEL/EPEL 9, which behaves like Fedora 34 and hence has Provides in both forms but Requires in the PEP 503 form (no dots).
This change is not compatible with RHEL/EPEL 8. If you need to have manual requirements in the specfile that should work on Fedora 37+ and RHEL/EPEL 8 in this form and the name includes a dot, we recommend using %py3_dist
.
This change is not relevant to RHEL 7.
This change is not compatible with EPEL 7. If you need to have manual requirements in the specfile that should work on Fedora 37+ and RHEL/EPEL 7 in this form and the name includes a dot, we recommend using %py3_dist
.
Feedback
Benefit to Fedora
- Less automatic provides in the repos - there are 93+93=186 provides like
python3dist(x.y)
andpython3.Xdist(x.y)
in rawhide today. - There will be only one way to express a Python package name in this context, not two.
- One more thing the Python maintainers will cross off their TODO list.
Scope
- Proposal owners:
- check there are really no more manual requirements with dots
- disable the automatically generated provides with dots when we update to Python 3.11
- double-check there are really no more manual requirements with dots
- Other developers:
- stop adding new manual Python dist requirements with dots
- Release engineering: not needed for this Change
- Policies and guidelines: they already only cover PEP 503
- Trademark approval: not needed for this Change
- Alignment with Objectives: not really
Upgrade/compatibility impact
This is done together with the Python 3.11 update to not have to deal with little problems, such as packages that can't be rebuilt after the manual requirements were changed.
How To Test
The following 2 commands should yield nothing:
$ repoquery --repo=rawhide --provides | grep -E '^python3(\.digit:+)?dist\(\S+\.\S+\)' $ repoquery --repo=rawhide{,-source} --requires | grep -E '^python3(\.digit:+)?dist\(\S+\.\S+\)'
With the exception of packages that failed to rebuild with Python 3.11 (and those will need to be dealt with anyway one way or another).
The following example commands should only give the variant with dashes:
$ repoquery --repo=rawhide --provides python3-ruamel-yaml | grep -E '^python3(\.digit:+)?dist\(' $ repoquery --repo=rawhide --provides python3-jaraco-path | grep -E '^python3(\.digit:+)?dist\('
There should be no new broken dependencies because of this.
Note that wiki is eating my double []
in the regexes above around :digit:
. See the page source for the actual commands :(
User Experience
The actual users should notice no difference.
Dependencies
We need Changes/Python3.11 to happen together with this.
Contingency Plan
- Contingency mechanism: the change owners will revert the change and the mass rebuild will handle the packages that need the legacy form of the provides
- Contingency deadline: mass rebuild
- Blocks release? No
Documentation
N/A (not a System Wide Change)