Bug 1573755

Summary: RPM installed pip should not recommend to pip install -U pip
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-pipAssignee: Miro Hrončok <mhroncok>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: bkabrda, cstratak, metherid, ncoghlan, tflink, TicoTimo, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-pip-9.0.3-2.fc28 python-pip-9.0.3-2.fc27 python-pip-9.0.3-2.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-09 21:25:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miro Hrončok 2018-05-02 08:10:52 UTC
When the RPM  packaged version of pip/pip3 is not the latest, the following is shown:

  You are using pip version 9.0.3, however version 10.0.1 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.

Note that:

1. "pip install --upgrade pip" will not run pip3, but python2 pip, so the message is wrong for pip3

2. "pip install --upgrade pip" will not work, you need --user or sudo in worst case

3. we should not recommend this in any way, users are doing this and later their pip stops working


Proposal:  Patch this behavior out (only show in venv).

Comment 1 Charalampos Stratakis 2018-05-02 09:49:05 UTC
Is the recommendation here about the message shown only, or also the capability to update pip through pip as well? I would prefer to resolve both of those cases.

Comment 2 Miro Hrončok 2018-05-02 10:37:01 UTC
This bugzilla is about the message only.

Comment 3 Alyssa Coghlan 2018-05-02 11:19:42 UTC
Currently the python3-pip package leaves the INSTALLER file in the Python package metadata alone, so it still reports itself as being installed by `pip`:

$ cat /usr/lib/python3.6/site-packages/pip-9.0.3.dist-info/INSTALLER
pip

(I ran "sudo dnf reinstall python3-pip" right before checking that, so it should definitely be the as-packaged file)

If that was fixed to say "rpm" for the system managed version, then instead of checking for venv-or-not, the patched message generation could check for installed-by-pip-or-not.

As per the discussion in https://github.com/pypa/pip/issues/5346#issuecomment-385231760, such a patch would actually be acceptable upstream, so Fedora would only need to carry the downstream patch for older pip versions.

Comment 4 Miro Hrončok 2018-05-02 11:41:56 UTC
We'd also need our rewheel patch to change the installer back to pip I guess to make this work in venv.

Comment 5 Miro Hrončok 2018-05-02 11:48:39 UTC
$ cat /usr/lib/python3.6/site-packages/pip-9.0.3.dist-info/INSTALLER
pip
$ echo rpm | sudo tee /usr/lib/python3.6/site-packages/pip-9.0.3.dist-info/INSTALLER
rpm
$ cat /usr/lib/python3.6/site-packages/pip-9.0.3.dist-info/INSTALLER
rpm
$ python3 -m venv testvenv
$ cat testvenv/lib/python3.6/site-packages/pip-9.0.3.dist-info/INSTALLER 
pip


I.e. no rewheel patch needed, yay!

Comment 6 Miro Hrončok 2018-05-04 12:31:11 UTC
https://src.fedoraproject.org/rpms/python-pip/pull-request/5

Nick, could you please review this approach? I think it's bulletproof, but I might have missed something.

Comment 7 Fedora Update System 2018-05-05 15:20:33 UTC
python-pip-9.0.3-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-7146cb4e7f

Comment 8 Fedora Update System 2018-05-06 10:09:20 UTC
python-pip-9.0.3-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-7146cb4e7f

Comment 9 Fedora Update System 2018-05-07 10:12:28 UTC
python-pip-9.0.3-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-b795b92cc0

Comment 10 Fedora Update System 2018-05-07 10:24:30 UTC
python-pip-9.0.3-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-fcbef2ab8c

Comment 11 Fedora Update System 2018-05-07 14:34:02 UTC
python-pip-9.0.3-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-b795b92cc0

Comment 12 Fedora Update System 2018-05-08 00:03:30 UTC
python-pip-9.0.3-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-fcbef2ab8c

Comment 13 Fedora Update System 2018-05-09 21:25:32 UTC
python-pip-9.0.3-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2018-05-13 20:17:45 UTC
python-pip-9.0.3-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2018-05-15 20:00:25 UTC
python-pip-9.0.3-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.