When pip is run outside of venv, don't show the upgrade warning
This is a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1573755 1. We put "rpm" inside pip's INSTALLER instead of "pip" 2. From pip, we check what's in INSTALLER and only show the warning if it's "pip". When a venv is cearted, pip is installed from wheel (trough rewheel), INSTALLER contains "pip". When virtualenv is used, pip is installed from the Interwebz via pip, so INSTALLER contains "pip". Upstream issue https://github.com/pypa/pip/issues/5346
This commit is contained in:
parent
8cd1535c34
commit
9a0914ebc4
2 changed files with 50 additions and 0 deletions
|
|
@ -44,6 +44,11 @@ Patch0: allow-stripping-given-prefix-from-wheel-RECORD-files.patch
|
|||
# Issue upstream: https://github.com/pypa/pip/issues/4288
|
||||
Patch1: emit-a-warning-when-running-with-root-privileges.patch
|
||||
|
||||
|
||||
# WIP upstream patch https://github.com/pypa/pip/issues/5346
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1573755
|
||||
Patch2: pip-nowarn-upgrade.patch
|
||||
|
||||
# Downstream only patch
|
||||
# Users are upgrading pip9 to pip10 by various manners,
|
||||
# one of them is `pip install --user --upgrade pip`.
|
||||
|
|
@ -186,6 +191,7 @@ tar -xf %{SOURCE1}
|
|||
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
sed -i '1d' pip/__init__.py
|
||||
|
||||
|
|
@ -276,6 +282,12 @@ ln -s ./pip%{python3_version} %{buildroot}%{_bindir}/pip-%{python3_version}
|
|||
ln -s ./pip-%{python2_version} %{buildroot}%{_bindir}/pip-2
|
||||
ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3
|
||||
|
||||
# Make sure the INSTALLER is not pip, otherwise Patch2 won't work
|
||||
# TODO Maybe we should make all our python packages have this?
|
||||
echo rpm > %{buildroot}%{python2_sitelib}/pip-%{version}.dist-info/INSTALLER
|
||||
%if 0%{?with_python3}
|
||||
echo rpm > %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/INSTALLER
|
||||
%endif
|
||||
|
||||
%if 0%{?with_tests}
|
||||
%check
|
||||
|
|
@ -320,8 +332,10 @@ py.test-%{python3_version} -m 'not network'
|
|||
%changelog
|
||||
* Fri May 04 2018 Miro Hrončok <mhroncok@redhat.com> - 9.0.3-2
|
||||
- Allow to import pip10's main from pip9's /usr/bin/pip
|
||||
- Do not show the "new version of pip" warning outside of venv
|
||||
Resolves: rhbz#1569488
|
||||
Resolves: rhbz#1571650
|
||||
Resolves: rhbz#1573755
|
||||
|
||||
* Thu Mar 29 2018 Charalampos Stratakis <cstratak@redhat.com> - 9.0.3-1
|
||||
- Update to 9.0.3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue