From 35262e63013d1de107774a9d1269a1cff3202f56 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 18 Feb 2016 19:35:33 +0200 Subject: [PATCH] Removes nova from requirements.txt Removes nova from the requirements.txt and instead add tools\tox_install.sh file, which takes care of installing nova. This is useful for Jenkins, as it needs nova in order to run its tests. Change-Id: Ia81a49b2cd35a17edfe5edab35bef42191c7f4af --- requirements.txt | 1 - tools/tox_install.sh | 41 +++++++++++++++++++++++++++++++++++++++++ tox.ini | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 tools/tox_install.sh diff --git a/requirements.txt b/requirements.txt index 7fe8915d..f2211dfb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,3 @@ oslo.utils>=3.4.0 # Apache-2.0 oslo.i18n>=2.1.0 # Apache-2.0 eventlet>=0.18.2 # MIT --e git+http://github.com/openstack/nova.git#egg=nova diff --git a/tools/tox_install.sh b/tools/tox_install.sh new file mode 100755 index 00000000..c0a6ca81 --- /dev/null +++ b/tools/tox_install.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +# compute-hyperv repo depends on nova, which doesn't exist on pypi. + +# This wrapper for tox's package installer will use the existing package +# if it exists, else use zuul-cloner if that program exists, else grab it +# from nova master via a hard-coded URL. That last case should only +# happen with devs running unit tests locally. + +# From the tox.ini config page: +# install_command=ARGV +# default: +# pip install {opts} {packages} + +ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner +nova_installed=$(echo "import nova" | python 2>/dev/null ; echo $?) + +set -e + +if [ $nova_installed -eq 0 ]; then + echo "ALREADY INSTALLED" > /tmp/tox_install.txt + echo "Nova already installed; using existing package" +elif [ -x "$ZUUL_CLONER" ]; then + export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH} + echo "ZUUL CLONER" > /tmp/tox_install.txt + cwd=$(/bin/pwd) + cd /tmp + $ZUUL_CLONER --cache-dir \ + /opt/git \ + git://git.openstack.org \ + openstack/nova + cd openstack/nova + pip install -e . + cd "$cwd" +else + echo "PIP HARDCODE" > /tmp/tox_install.txt + pip install -U -egit+https://git.openstack.org/openstack/nova#egg=nova +fi + +pip install -U $* +exit $? \ No newline at end of file diff --git a/tox.ini b/tox.ini index b5a0b073..324b025f 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ usedevelop = True # tox is silly... these need to be separated by a newline.... whitelist_externals = bash find -install_command = pip install --allow-external -U --force-reinstall {opts} {packages} +install_command = {toxinidir}/tools/tox_install.sh {opts} {packages} # Note the hash seed is set to 0 until hyperv can be tested with a # random hash seed successfully. setenv = VIRTUAL_ENV={envdir}