From 8bad9fe19d09eb2e49fd44b92c57ee5acf85b558 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Thu, 9 May 2019 13:49:16 -0500 Subject: [PATCH] Add upper-constraints enforcement for local reqs This adds the use of upper constraints in our tox environments. Jobs like openstack-tox-py27 have started failing due to trying to install lib versions that only support Python 3. The 'generate' target keeps the unconstrained deps since we actually do need the latest installed for that. Updates the requirements-integration job to run using py36 since that now fails with running under py27. This should get the job to pass until we are able to rewrite it to not be a legacy job. NOTE(dmllr): updated install_command to include local constraints file Change-Id: I2598503c2d4397d7efbb03a76df9a4e91dd0c1cf Signed-off-by: Sean McGinnis --- playbooks/requirements-integration-dsvm/run.yaml | 1 + tox.ini | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/playbooks/requirements-integration-dsvm/run.yaml b/playbooks/requirements-integration-dsvm/run.yaml index faab42131b..157bd9a0e1 100644 --- a/playbooks/requirements-integration-dsvm/run.yaml +++ b/playbooks/requirements-integration-dsvm/run.yaml @@ -122,6 +122,7 @@ export DEVSTACK_GATE_EXERCISES=0 export DEVSTACK_GATE_REQS_INTEGRATION=1 export PIP_PROCESS_DEPENDENCY_LINKS=1 + export USE_PYTHON3=true function gate_hook { set -x bash $BASE/new/devstack-gate/devstack-vm-gate.sh && \ diff --git a/tox.ini b/tox.ini index 22db546649..d9effdfaf7 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ ignore_basepython_conflict=true [testenv] basepython = python3 usedevelop = True -install_command = pip install -U {opts} {packages} +install_command = pip install -U {opts} -c {toxinidir}/upper-constraints.txt {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -16,13 +16,11 @@ commands = [testenv:py27-check-uc] basepython = python2.7 -install_command = pip install -U {opts} -c {toxinidir}/upper-constraints.txt {packages} deps = -r{toxinidir}/upper-constraints.txt commands = check-conflicts {toxinidir}/upper-constraints.txt {toxinidir}/upper-constraints-xfails.txt [testenv:py36-check-uc] basepython = python3.6 -install_command = pip install -U {opts} -c {toxinidir}/upper-constraints.txt {packages} deps = -r{toxinidir}/upper-constraints.txt commands = check-conflicts {toxinidir}/upper-constraints.txt {toxinidir}/upper-constraints-xfails.txt @@ -33,6 +31,10 @@ commands = {posargs} commands = update-requirements {posargs} [testenv:generate] +# Generate needs an unconstrained install to get new dependencies +install_command = pip install -U {opts} {packages} +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt commands = generate-constraints {posargs} [testenv:validate] @@ -88,7 +90,6 @@ commands = [testenv:babel] # Use the local upper-constraints.txt file deps = Babel -install_command = pip install -c upper-constraints.txt {opts} {packages} commands = {toxinidir}/tools/babel-test.sh [flake8]