Add tox_install.sh to deal with upper-constraints

shade is in global requirements and upper-constraints now, which means
we need to use the tox_install.sh script so that constraints don't break
install of shade itself.

Change-Id: Id286b634046519e34ac2c01461391d5bc61cd919
This commit is contained in:
Monty Taylor 2017-08-31 08:38:33 -05:00
parent 69e8847083
commit 78a1aa3b93
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 37 additions and 3 deletions

30
tools/tox_install.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Client constraint file contains this client version pin that is in conflict
# with installing the client from source. We should remove the version pin in
# the constraints file before applying it for from-source installation.
CONSTRAINTS_FILE=$1
shift 1
set -e
# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get
# published to logs.openstack.org for easy debugging.
localfile="$VIRTUAL_ENV/log/upper-constraints.txt"
if [[ $CONSTRAINTS_FILE != http* ]]; then
CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
fi
# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep
curl $CONSTRAINTS_FILE --insecure --progress-bar --output $localfile
pip install -c$localfile openstack-requirements
# This is the main purpose of the script: Allow local installation of
# the current repo. It is listed in constraints file and thus any
# install will be constrained and we need to unconstrain it.
edit-constraints $localfile -- $CLIENT_NAME
pip install -c$localfile -U $*
exit $?

10
tox.ini
View File

@ -7,25 +7,29 @@ skipsdist = True
usedevelop = True
basepython = {env:SHADE_TOX_PYTHON:python2}
passenv = UPPER_CONSTRAINTS_FILE
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {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}
setenv =
VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
BRANCH_NAME=master
CLIENT_NAME=shade
deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
[testenv:functional]
setenv =
{[testenv]setenv}
OS_TEST_PATH = ./shade/tests/functional
passenv = OS_* SHADE_*
passenv = OS_* SHADE_* UPPER_CONSTRAINTS_FILE
commands = python setup.py testr --slowest --testr-args='--concurrency=1 {posargs}'
[testenv:functional-tips]
setenv =
{[testenv]setenv}
OS_TEST_PATH = ./shade/tests/functional
passenv = OS_* SHADE_*
passenv = {OS_* SHADE_* UPPER_CONSTRAINTS_FILE
whitelist_externals = bash
commands =
bash -x {toxinidir}/extras/install-tips.sh