Bug 1874803 - Make patch 189 (Use RPM wheels) applicable at any time, upstream it for Python 3.10
Summary: Make patch 189 (Use RPM wheels) applicable at any time, upstream it for Pytho...
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.10
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Victor Stinner
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1287556
TreeView+ depends on / blocked
Reported: 2020-09-02 09:37 UTC by Miro Hrončok
Modified: 2021-02-13 01:18 UTC (History)
8 users (show)

Fixed In Version: python3.10-3.10.0~a5-1.fc33 python3.10-3.10.0~a5-1.fc32
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed: 2021-02-06 01:17:37 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Python 42856 0 None None None 2021-01-07 11:21:57 UTC

Description Miro Hrončok 2020-09-02 09:37:09 UTC
Currently, we apply patch 189 bconditionally:

    %if %{with rpmwheels}
    %patch189 -p1
    rm Lib/ensurepip/_bundled/*.whl

Since 3.9 no longer has the %ifarched lib64 patch (102), it would really be convenient if we can finally get rid of this antipattern and adapt 189 to be applicable at any time, like this:

    %autosetup -p1
    %if %{with rpmwheels}
    rm Lib/ensurepip/_bundled/*.whl

The necessary code change would be: ensurepip module "simply" prefers the bundled wheels when they are present, falls back to /usr/share/python-wheels if the bundled wheels are not there.

That could also make the patch little bit more upstreamable.

The idea to upstream this patch is as follows:

 1. When Python is built, there is a configure option (e.g. --shared-wheels-directory=/usr/share/python-wheels)

 2. The value is baked into sysconfig (e.g. sysconfig.get_config_var('SHARED_WHEELS_DIRECTORY') == '/usr/share/python-wheels' or None)

 3. When ensurepip is called, it checks the SHARED_WHEELS_DIRECTORY value:

 3a. If it is None, it takes wheels from _bundled
 3b. If it is set to an existing directory, it takes wheels from that directory
 3c. If it is set to anything else, it fails

 4. The wheels' versions and filenames need to be figured out at runtime (as we do now in patch 189).

Comment 2 Petr Viktorin (pviktori) 2020-11-24 10:08:59 UTC
Victor, what's the status here?

Comment 3 Victor Stinner 2020-12-03 13:22:45 UTC
> Victor, what's the status here?

Last weeks, I focused on helping to fix https://bugzilla.redhat.com/show_bug.cgi?id=1890881 (Fedora Python 3.10 COPR) blocker issues. I didn't work on this issue.

Comment 4 Petr Viktorin (pviktori) 2021-01-05 10:05:20 UTC
Victor, is this still a priority for you?

Comment 5 Victor Stinner 2021-01-07 11:22:00 UTC
I created https://bugs.python.org/issue42856 and I'm working on an upstream PR.

Comment 6 Miro Hrončok 2021-01-28 16:44:22 UTC
This is ready in 3.10 upstream, will be part of the next alpha release.

We'll use it there and if it proves nicer than what we have, we can consider whether to replace our patch in previous releases with this one.

Comment 7 Fedora Update System 2021-02-05 23:31:18 UTC
FEDORA-2021-851c6e4e2d has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-851c6e4e2d

Comment 8 Fedora Update System 2021-02-05 23:31:50 UTC
FEDORA-2021-d5cde50865 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-d5cde50865

Comment 9 Fedora Update System 2021-02-06 01:17:37 UTC
FEDORA-2021-851c6e4e2d has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2021-02-13 01:18:02 UTC
FEDORA-2021-d5cde50865 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.