From e17011c67eb72abfc8896a1a1e53168036bed48b Mon Sep 17 00:00:00 2001 From: zhurong Date: Wed, 6 Jul 2016 21:25:45 -0400 Subject: [PATCH] Use upper-constraints in tox test environments This will force pip install to use the upper-constraints.txt specified version of pip modules. When you don't do this, you are out on the bleeding edge and become unstable everytime some python library in the wide world changes in a way that you don't expect. The releasenotes job has no constraints file, so override the install command there. Change-Id: I5c2d878c79dcf1ce1715218950c07a39314b16ff Partial-bug: #1598906 --- tox.ini | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 38124759..38984a32 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ skipsdist = True setenv = VIRTUAL_ENV={envdir} passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY usedevelop = True -install_command = pip install {opts} {packages} +install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = @@ -20,9 +20,17 @@ commands = flake8 {posargs} [testenv:venv] +# NOTE(from nova tox.ini by jaegerandi): This target does not use constraints +# because upstream infra does not yet support it. Once that's fixed, we can +# drop the install_command. +install_command = pip install -U --force-reinstall {opts} {packages} commands = {posargs} [testenv:cover] +# NOTE(from nova tox.ini by jaegerandi): This target does not use constraints +# because upstream infra does not yet support it. Once that's fixed, we can +# drop the install_command. +install_command = pip install -U --force-reinstall {opts} {packages} commands = python setup.py testr --coverage --testr-args='{posargs}' [testenv:docs] @@ -36,6 +44,10 @@ commands = flake8 commands = oslo-config-generator --config-file etc/oslo-config-generator/muranoagent.conf [testenv:releasenotes] +# NOTE(from nova tox.ini by jaegerandi): This target does not use constraints +# because upstream infra does not yet support it. Once that's fixed, we can +# drop the install_command. +install_command = pip install -U --force-reinstall {opts} {packages} commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [flake8]