Update tox install to support constraints and branches

Update tox.ini and tox_install.sh to support constraints and branches.
This also includes an update per [1].

[1] http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: I6e126fb6ef9048dd00190bf19e2f3c2e8ce21155
This commit is contained in:
Li Ma 2016-10-13 12:03:48 +08:00
parent d1c05b242b
commit 2bee5d94df
2 changed files with 14 additions and 4 deletions

View File

@ -15,11 +15,20 @@
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
BRANCH_NAME=master
set -ex
cwd=$(/bin/pwd)
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Neutron already installed; using existing package"
@ -29,16 +38,17 @@ elif [ -x "$ZUUL_CLONER" ]; then
export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH}
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch $BRANCH_NAME \
git://git.openstack.org \
openstack/neutron
cd openstack/neutron
pip install -e .
$install_cmd -e .
cd "$cwd"
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
pip install -U -egit+https://git.openstack.org/openstack/neutron#egg=neutron
$install_cmd -U -egit+https://git.openstack.org/openstack/neutron@$BRANCH_NAME#egg=neutron
fi
pip install -U $*
$install_cmd -U $*
pip install python-etcd
exit $?

View File

@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
install_command = {toxinidir}/tools/tox_install.sh {opts} {packages}
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh