From 90db9af77b1d31e7c22e6dc181c8b8c6f00b821e Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Thu, 13 Sep 2018 15:31:30 -0400 Subject: [PATCH] Use --user for tox install instead of virtualenv Allows us to remove the workaround of installing lftools in a venv before as the virtualenvs should no longer be conflicting. Change-Id: Ic466cd74a568e0de2fbb0f3fd75205cd04c1e3f9 Signed-off-by: Thanh Ha --- jjb/lf-python-jobs.yaml | 6 +----- shell/python-tools-install.sh | 5 +++-- shell/tox-install.sh | 8 ++------ shell/tox-run.sh | 5 +---- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index ef4fc705..2de5d8b0 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -465,11 +465,7 @@ jenkins-ssh-credential: '{jenkins-ssh-credential}' builders: - - shell: !include-raw-escape: - # Workaround issue where the tox run later breaks the lftools virtualenv. - # Without running the install first the run in the publisher will fail - # due to missing lftools because it gets installed into a tox venv. - - ../shell/lftools-install.sh + - lf-infra-pre-build - lf-infra-tox-install: python-version: '{python-version}' - shell: !include-raw-escape: ../shell/tox-run.sh diff --git a/shell/python-tools-install.sh b/shell/python-tools-install.sh index 5866ea5c..f1918aa8 100644 --- a/shell/python-tools-install.sh +++ b/shell/python-tools-install.sh @@ -19,6 +19,7 @@ python-heatclient~=1.16.1 python-openstackclient~=3.16.0 EOF -pip install --user --quiet --upgrade pip==18.0 setuptools==40.0.0 -pip install --user --quiet --upgrade -r "$REQUIREMENTS_FILE" +# Use `python -m pip` to ensure we are using the latest version of pip +python -m pip install --user --quiet --upgrade pip==18.0 setuptools==40.0.0 +python -m pip install --user --quiet --upgrade -r "$REQUIREMENTS_FILE" pip freeze diff --git a/shell/tox-install.sh b/shell/tox-install.sh index 9e50ead4..3aceceb2 100644 --- a/shell/tox-install.sh +++ b/shell/tox-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -14,11 +14,7 @@ echo "---> tox-install.sh" # DO NOT set -u as virtualenv's activate script has unbound variables set -e -o pipefail -virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox" -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" -pip install --quiet --upgrade "pip==9.0.3" setuptools -pip install --quiet --upgrade argparse detox "tox<3.0.0" tox-pyenv +python -m pip install --user --quiet --upgrade argparse detox "tox<3.0.0" tox-pyenv echo "----> pip freeze" pip freeze diff --git a/shell/tox-run.sh b/shell/tox-run.sh index 6b451166..47380010 100644 --- a/shell/tox-run.sh +++ b/shell/tox-run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -10,9 +10,6 @@ ############################################################################## echo "---> tox-run.sh" -# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 -source "/tmp/v/tox/bin/activate" - # Ensure we fail the job if any steps fail. # DO NOT set -u as virtualenv's activate script has unbound variables set -e -o pipefail -- 2.16.6