Install last stable version of get-pip.py script

The get-pip script does not work well with Python 2 and
it raise error during the installation [1].

[1] https://github.com/pypa/get-pip/issues/83

Change-Id: I3755c34da313ef647547c6ae18b59cc04c2cdd60
This commit is contained in:
Daniel Pawlik 2021-01-26 17:53:02 +01:00
parent 2737d909bf
commit 383fab59e9
2 changed files with 15 additions and 1 deletions

View File

@ -122,7 +122,10 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then
fi
# install the latest python2 pip; this overwrites packaged pip
# NOTE(dpawlik) The get-pip.py script is not base on master release.
# Ensure that is uses latest available version.
python /tmp/get-pip.py ${pip_args}
python -m pip install ${pip_args} pip
# Install latest setuptools; there is a slight chicken-egg issue in
# that pip requires setuptools for some operations like building a
@ -141,7 +144,10 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then
# python2 would work -- alas get-pip.py doesn't seem to leave
# python3 alone:
# https://github.com/pypa/pip/issues/4435
# NOTE(dpawlik) The get-pip.py script is not base on master release.
# Ensure that is uses latest available version.
python3 /tmp/get-pip.py ${pip_args}
python3 -m pip install ${pip_args} pip
pip3 install ${pip_args} setuptools
# on < 27, this installed pip3 to /usr/bin/pip. On >=27 it's
@ -250,6 +256,11 @@ else
python3 /tmp/get-pip.py $pip_args
python2 /tmp/get-pip.py $pip_args
# NOTE(dpawlik) The get-pip.py script is not base on master release.
# Ensure that is uses latest available version.
python3 -m pip install $pip_args pip
python2 -m pip install $pip_args pip
pip3 install $pip_args virtualenv
pip install $pip_args virtualenv
fi

View File

@ -1 +1,4 @@
pip-and-virtualenv file /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
# NOTE(dpawlik) We set get-pip.py script to use 3.5 version, that is compatible
# with python2.7 and newer. It should be removed in the future, when Python 2
# is dropped.
pip-and-virtualenv file /tmp/get-pip.py https://bootstrap.pypa.io/3.5/get-pip.py