From ad38ce1fc98692ee59ef061de1a35f355d219aa1 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Mon, 27 Jul 2015 15:55:32 +1000 Subject: [PATCH] Add constraint target to tox.ini This adds a pip install command to tox.ini that is only used when the tox env is passed with the 'constraints' factor appended onto it. As such this will not effect developer workflows or current unit tests. The initial use of this will be in a non-voting job, to verify that the constrained checks with tox are stable. DevStack is already running constrained jobs, as such problems are no expected. To run a tox with pip using constraints on a developer system a developer should run the desired tox environment with -constraints. For example: $(tox -epy27-constraints) Pip will pull the current version of the upper-constraints.txt file down from the git.openstack.org, however this method can be overriden to use a local file setting the environment variable "UPPER_CONSTRAINTS_FILE" to the local path or a different URL, it is passed directly to pip. This is currently not enabled in the default tox run, however it is possible to enable it as a default by adding it to 'envlist' in tox.ini Depends-On: I17ac389f78af241917b6da7f049085f2b13d30f2 Change-Id: I8ea1710a4e3a287405978b467e0b2dfbb025b795 Implements Blueprint: Requirements-Management --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index cdfd48dd12de..35691660466d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -minversion = 1.6 +minversion = 1.8 envlist = py34,py27,functional,pep8,pip-missing-reqs skipsdist = True @@ -9,7 +9,9 @@ usedevelop = True whitelist_externals = bash find rm -install_command = pip install -U --force-reinstall {opts} {packages} +install_command = + constraints: pip install -U --force-reinstall -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} + pip install -U --force-reinstall {opts} {packages} setenv = VIRTUAL_ENV={envdir} OS_TEST_PATH=./nova/tests/unit LANGUAGE=en_US