From e1a66af4a894b83f27f90eef0826398445b4df97 Mon Sep 17 00:00:00 2001 From: Elod Illes Date: Thu, 28 Apr 2022 18:00:47 +0200 Subject: [PATCH] [CI] Add upper constraints to install command In cases when a package is installed in tox's develop-inst phase upper constraints are not used if it were not defined in 'deps' of the tox target. This caused for example 'tox -e docs' to fail in case a package introduced some branch incompatible change. There are two option to fix this: * add the upper constraints to 'deps' of the target (and pre-install requirements for some cases) OR * use it in the install_command In the past the latter needed some extra attention (due to e.g. lower constraints tests) and projects were encouraged to remove the install_command, but nowadays this seems better fitting for some project and easier to use. So this patch fixes the upper constraints usage via the custom install_command and by removing it from 'deps'. Conflicts: tox.ini NOTE(elod.illes): conflict is due to branch specific upper constraints link. Change-Id: Iae07e1c5abde09874928951ac55c2d0355bcd244 (cherry picked from commit 36aedba20e998953333225a9788c084d2e6be6ae) (cherry picked from commit 49d25474a2cfa1c91649241471c4b7b1b799fd75) --- tox.ini | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 36b23b97bf..af38604254 100644 --- a/tox.ini +++ b/tox.ini @@ -24,9 +24,8 @@ setenv = # clue for oslo.db to use file-based database. OS_TEST_DBAPI_ADMIN_CONNECTION=sqlite:////tmp/placeholder-never-created-nor-used.db usedevelop = True -install_command = pip install {opts} {packages} -deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/xena} - -r{toxinidir}/test-requirements.txt +install_command = python -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/xena} {opts} {packages} +deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = find . -type f -name "*.pyc" -delete @@ -97,7 +96,6 @@ commands = # This environment is called from CI scripts to test and publish # the API Ref to docs.openstack.org. deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/xena} -r{toxinidir}/doc/requirements.txt commands = rm -rf api-ref/build @@ -149,7 +147,6 @@ paths = ./glance/hacking [testenv:docs] deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/xena} -r{toxinidir}/doc/requirements.txt commands = rm -fr doc/build @@ -164,7 +161,6 @@ commands = {posargs} [testenv:releasenotes] deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/xena} -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html