From 3589a5ded6adbfea0510f1f86a73d8a613d86ef7 Mon Sep 17 00:00:00 2001 From: Marcellin Fom Tchassem Date: Tue, 5 Apr 2016 09:19:56 -0500 Subject: [PATCH] Make tox respect upper-constraints.txt 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. Post jobs are not yet compatible with the upper-constraints file, so override the install_command there to skip upper-constraints. Credit to the equivalent Ironic patch https://review.openstack.org/#/c/300146/ Conflicts: CONTRIBUTING.rst tox.ini Change-Id: Ica668afedf622a0be8e8566ac88e1d0020ed9bc7 Closes-Bug: #1563038 (cherry picked from commit 16594518f3bbf8637d4dad6c42cc8712024e3b2d) --- CONTRIBUTING.rst | 4 ++++ tox.ini | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index cbb77c5e0..bf07147d6 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -52,6 +52,10 @@ interpreter of one of supported versions (currently 2.7 and 3.4), use Support for Python 3 is highly experimental, stay with Python 2 for the production environment for now. +.. note:: + Users of Fedora <= 23 will need to run "sudo dnf --releasever=24 update + python-virtualenv" to run unit tests + There is a simple functional test that involves fetching the ramdisk from Github:: diff --git a/tox.ini b/tox.ini index 6e5939cf4..0114e3a81 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ envlist = py27,py34,pep8,func [testenv] usedevelop = True +install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/liberty} {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -14,9 +15,21 @@ setenv = PYTHONDONTWRITEBYTECODE=1 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:venv] +# NOTE(amrith) The setting of the install_command in this location +# is only required because currently infra does not actually +# support constraints files for the environment job, and while +# the environment variable UPPER_CONSTRAINTS_FILE is set, there's +# no file there. It can be removed when infra changes this. +install_command = pip install -U {opts} {packages} commands = {posargs} [testenv:releasenotes] +# NOTE(amrith) The setting of the install_command in this location +# is only required because currently infra does not actually +# support constraints files for the release notes job, and while +# the environment variable UPPER_CONSTRAINTS_FILE is set, there's +# no file there. It can be removed when infra changes this. +install_command = pip install -U {opts} {packages} envdir = {toxworkdir}/venv commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html