Python Dist provides to only provide PEP503-complaint 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-01-21
- FESCo issue: <will be assigned by the Wrangler>
- Tracker bug: <will be assigned by the Wrangler>
- Release notes tracker: <will be assigned by the Wrangler>
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_dsit
.
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_dsit
.
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 way 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 --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: (What to do? Who will do it?) N/A (not a System Wide Change)
- Contingency deadline: N/A (not a System Wide Change)
- Blocks release? N/A (not a System Wide Change), Yes/No
Documentation
N/A (not a System Wide Change)