commit bb630f047f4807451fa4ecb4ab2539458f659b95 Author: Jonathan Rosser Date: Tue Oct 6 13:23:16 2020 +0100 Use pip and virtualenv from host packages rather than get-pip.py For focal, using pip to install python tools to the host results in a incompatiblity and subsequent job failure when openstack_hosts later installs the distro package for virtualenv. The python_venv_build role then fails to be able to create a virtualenv. This patch changes the host setup in the tests repo to be the same as that in the integrated repo. Change-Id: Ief99ea7e969f67130be68ac437b4b16be80cb088 diff --git a/run_tests_common.sh b/run_tests_common.sh index 7665150..654724f 100755 --- a/run_tests_common.sh +++ b/run_tests_common.sh @@ -51,13 +51,13 @@ case "${ID,,}" in pkg_list="ca-certificates-mozilla python-devel python-xml lsb-release ${extra_suse_deps:-}" ;; amzn|centos|rhel) - pkg_list="python3-devel redhat-lsb-core" + pkg_list="python3-devel python3-virtualenv redhat-lsb-core" ;; fedora) - pkg_list="python3-devel redhat-lsb-core redhat-rpm-config yum-utils" + pkg_list="python3-devel python3-virtualenv redhat-lsb-core redhat-rpm-config yum-utils" ;; ubuntu|debian) - pkg_list="python3-dev lsb-release curl" + pkg_list="python3-dev python3-pip virtualenv lsb-release curl" sudo apt-get update ;; gentoo) @@ -71,18 +71,14 @@ case "${ID,,}" in esac eval sudo ${pkg_mgr_cmd} ${pkg_list} -# Install pip -if ! which pip3 &>/dev/null; then - curl --silent --show-error --retry 5 \ - https://bootstrap.pypa.io/3.3/get-pip.py | sudo python3 -fi +PIP_EXEC_PATH=$(which pip3 || which pip) # Install bindep and tox if [[ "${ID,,}" == "centos" ]] && [[ ${VERSION_ID} == "8" ]]; then sudo alternatives --set python /usr/bin/python3 - sudo pip3 install 'bindep>=2.4.0' tox + sudo "${PIP_EXEC_PATH}" install 'bindep>=2.4.0' tox else - sudo pip3 install 'bindep>=2.4.0' tox + sudo "${PIP_EXEC_PATH}" install 'bindep>=2.4.0' tox fi if [[ "${ID,,}" == "fedora" ]]; then