]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add constraint target to tox.ini
authorSachi King <nakato@nakato.io>
Tue, 1 Sep 2015 05:10:54 +0000 (15:10 +1000)
committerAssaf Muller <amuller@redhat.com>
Wed, 16 Sep 2015 15:01:03 +0000 (15:01 +0000)
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

Closes-Bug: #1496424
Change-Id: I13579599dfdf846d06d8c39f33265e8b46db6e68
Depends-On: I17ac389f78af241917b6da7f049085f2b13d30f2
Implements Blueprint: Requirements-Management
(cherry picked from commit c029954c8ae041e5f15b14ceef0e2aa060928e05)

tox.ini

diff --git a/tox.ini b/tox.ini
index c92988f998fc8abbbb8f57c1f0a818bf7e27636e..648b9df9e60a2d80fa918a38b9d306854250e3d5 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -7,7 +7,9 @@ skipsdist = True
 setenv = VIRTUAL_ENV={envdir}
 passenv = TRACE_FAILONLY
 usedevelop = True
-install_command = pip install -U {opts} {packages}
+install_command =
+                  constraints: pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
+                  pip install -U {opts} {packages}
 deps = -r{toxinidir}/requirements.txt
        -r{toxinidir}/test-requirements.txt
 whitelist_externals = sh