From a73ba62920e643355ce6e9b836c075f139623fd9 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 16 Nov 2011 01:30:40 -0200 Subject: [PATCH] Changes to make pip-based tests work with jenkins. The git line for the cisco pip-requires was wrong. The venv needs to be installed in the source tree, not in the home directory for self-contained builds. The version of python can't be assumed and must be calculated. Change-Id: I23d381eb273e82796e309483086dc68f27ce6093 --- plugins/cisco-plugin/pip-requires | 2 +- tools/install_venv.py | 7 +++++-- tools/with_venv.sh | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/cisco-plugin/pip-requires b/plugins/cisco-plugin/pip-requires index 3d710597b..dcd1ed51e 100644 --- a/plugins/cisco-plugin/pip-requires +++ b/plugins/cisco-plugin/pip-requires @@ -1 +1 @@ -http://github.com/CiscoSystems/ncclient.git +-e git+https://github.com/CiscoSystems/ncclient.git#egg=ncclient diff --git a/tools/install_venv.py b/tools/install_venv.py index 16db23587..8bb57849a 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -29,9 +29,12 @@ import sys ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) -VENV = os.path.expanduser('~/.quantum-venv') +VENV = os.path.join(ROOT, '.quantum-venv') +PY_VERSION = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) + VENV_EXISTS = bool(os.path.exists(VENV)) + # Find all pip-requires in the project PIP_REQUIRES = [] for root, dirs, files in os.walk(os.path.join(ROOT)): @@ -107,7 +110,7 @@ def install_dependencies(venv=VENV): run_command(cmd, redirect_output=False) # Tell the virtual env how to "import quantum" - pthfile = os.path.join(venv, "lib", "python2.6", "site-packages", + pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages", "quantum.pth") f = open(pthfile, 'w') f.write("%s\n" % ROOT) diff --git a/tools/with_venv.sh b/tools/with_venv.sh index 88444a240..83149462c 100755 --- a/tools/with_venv.sh +++ b/tools/with_venv.sh @@ -17,5 +17,5 @@ # under the License. TOOLS=`dirname $0` -VENV=~/.quantum-venv +VENV=$TOOLS/../.quantum-venv source $VENV/bin/activate && $@ -- 2.45.2