From 78a1aa3b931b2ad7fd2820292ba4060eb6feb043 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 31 Aug 2017 08:38:33 -0500 Subject: [PATCH] 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 --- tools/tox_install.sh | 30 ++++++++++++++++++++++++++++++ tox.ini | 10 +++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100755 tools/tox_install.sh diff --git a/tools/tox_install.sh b/tools/tox_install.sh new file mode 100755 index 000000000..43468e450 --- /dev/null +++ b/tools/tox_install.sh @@ -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 $? diff --git a/tox.ini b/tox.ini index e2421549e..688c837a4 100644 --- a/tox.ini +++ b/tox.ini @@ -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