From 43e8d01716072314eb7d90cb1da1db4b431bb6cd Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Fri, 29 Jan 2021 11:33:45 -0500 Subject: [PATCH] Remove python2 tox installation Update path to ensure that tox from tox-install.sh is run Should still work for python2 tox as pyenv will continue to provide a py2 env Signed-off-by: Aric Gardner Change-Id: I568ebf679bbce20b76a0a686699702f81e7e7777 --- shell/tox-install.sh | 18 +----------------- shell/tox-run.sh | 6 ++++++ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/shell/tox-install.sh b/shell/tox-install.sh index 78716b05..02db0c27 100644 --- a/shell/tox-install.sh +++ b/shell/tox-install.sh @@ -14,23 +14,7 @@ echo "---> tox-install.sh" # Use -x to show value of $PYTHON in output set -eux -o pipefail -#Python 3.5 and python2 tox in Ubuntu 16.04 workaround -done="False" -if [[ -f /etc/lsb-release ]]; then - # shellcheck disable=SC1091 - source /etc/lsb-release - if [[ $DISTRIB_RELEASE == "16.04" ]]; then - echo "WARNING: Python projects should move to Ubuntu 18.04 to continue receiving support" - python2 -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv more-itertools~=5.0.0 - python3 -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv zipp==1.1.0 - done="True" - fi -fi - -if [[ $done != "True" ]]; then - python -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv zipp more-itertools~=5.0.0 - python3 -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv -fi +python3 -m pip install --user --quiet --upgrade tox tox-pyenv virtualenv # installs are silent, show version details in log $PYTHON --version diff --git a/shell/tox-run.sh b/shell/tox-run.sh index 91e040ad..68a5af94 100644 --- a/shell/tox-run.sh +++ b/shell/tox-run.sh @@ -13,6 +13,9 @@ echo "---> tox-run.sh" # do not use -o pipefail set -eux +#Ensure that tox from tox-install.sh takes precedence. +PATH=$HOME/.local/bin:$PATH + ARCHIVE_TOX_DIR="$WORKSPACE/archives/tox" ARCHIVE_DOC_DIR="$WORKSPACE/archives/docs" mkdir -p "$ARCHIVE_TOX_DIR" @@ -27,6 +30,9 @@ if [[ -d /opt/pyenv ]]; then export TOX_TESTENV_PASSENV=PYTHONPATH fi +#Useful debug +tox --version + PARALLEL="${PARALLEL:-true}" if [[ ${PARALLEL,,} = true ]]; then if [[ -n ${TOX_ENVS:-} ]]; then -- 2.16.6