Use python3 pip module instead of pip binary

Focal only provides a pip3 binary, no pip3.8. Instead of working around
that with a symlink, use the module instead.

Add version information output for this variant.

Change-Id: I7af194ecc40e4d43c10ce067a661bb6ab4ca37d4
This commit is contained in:
Jens Harbott 2020-06-11 05:51:26 +00:00
parent c2c2b6b415
commit f1ed7c77c5
4 changed files with 15 additions and 8 deletions

View File

@ -27,6 +27,7 @@ openssl
pkg-config
psmisc
python3-dev
python3-pip
python3-venv
tar
tcpdump

View File

@ -24,6 +24,7 @@ pkgconfig
postgresql-devel # psycopg2
psmisc
python3-devel
python3-pip
redhat-rpm-config # missing dep for gcc hardening flags, see rhbz#1217376
systemd-devel # for systemd-python
tar

View File

@ -174,7 +174,7 @@ function pip_install {
if python3_enabled; then
echo "Using python $PYTHON3_VERSION to install $package_dir because python3_enabled=True"
sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
cmd_pip=$(get_pip_command $PYTHON3_VERSION)
cmd_pip="python$PYTHON3_VERSION -m pip"
else
echo "Using python $PYTHON2_VERSION to install $package_dir because python3_enabled=False"
cmd_pip=$(get_pip_command $PYTHON2_VERSION)
@ -217,7 +217,7 @@ function pip_uninstall {
local sudo_pip="sudo -H"
if python3_enabled; then
sudo_pip="$sudo_pip LC_ALL=en_US.UTF-8"
cmd_pip=$(get_pip_command $PYTHON3_VERSION)
cmd_pip="python$PYTHON3_VERSION -m pip"
else
cmd_pip=$(get_pip_command $PYTHON2_VERSION)
fi

View File

@ -5,7 +5,7 @@
# Update pip and friends to a known common version
# Assumptions:
# - if USE_PYTHON3=True, PYTHON3_VERSION refers to a version already installed
# - PYTHON3_VERSION refers to a version already installed
set -o errexit
@ -53,6 +53,8 @@ function get_versions {
else
echo "pip: Not Installed"
fi
# Show python3 module version
python${PYTHON3_VERSION} -m pip --version
}
@ -125,7 +127,14 @@ function configure_pypi_alternative_url {
# Show starting versions
get_versions
# Do pip
if [[ -n $PYPI_ALTERNATIVE_URL ]]; then
configure_pypi_alternative_url
fi
# Just use system pkgs on Focal
if [[ "$DISTRO" == focal ]]; then
exit 0
fi
# Eradicate any and all system packages
@ -143,10 +152,6 @@ fi
install_get_pip
if [[ -n $PYPI_ALTERNATIVE_URL ]]; then
configure_pypi_alternative_url
fi
set -x
# Note setuptools is part of requirements.txt and we want to make sure