Update UPPER_CONSTRAINTS_FILE for stable/pike

Backport - 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: I5424028a2037d7b4918e7d6b3b173617abdafde7
This commit is contained in:
2017-07-28 21:08:42 +00:00
committed by Monty Taylor
parent 2179a00f3f
commit 274ca79fbd
2 changed files with 38 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 $?

11
tox.ini
View File

@@ -6,25 +6,30 @@ skipsdist = True
[testenv]
usedevelop = True
basepython = {env:SHADE_TOX_PYTHON:python2}
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
passenv = UPPER_CONSTRAINTS_FILE
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
BRANCH_NAME=stable/pike
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