Always constraint dependencies in tox

For most of our tox jobs we use the usedevelop, which means that tox
will do a pip install -e on our source code on its own.

This means that first it will install deps (which has the constraints)
and then cinder without constraints, since they are defined in deps, and
will pull cinder dependencies ignoring the constraints.

This patch changes how we install dependencies for all tox jobs except
the lower-constraints one, and will make sure that they are always
properly constrained by changing our install_command to include the -c
option.

Change-Id: Ic9a6ac412a334710eb5e45935cd301ca80a5edb9
This commit is contained in:
Gorka Eguileor 2021-03-16 16:47:12 +01:00
parent a66f688992
commit 5ad7fe9269
1 changed files with 3 additions and 3 deletions

View File

@ -16,9 +16,9 @@ setenv = VIRTUAL_ENV={envdir}
OS_TEST_TIMEOUT=60
OS_TEST_PATH=./cinder/tests/unit
usedevelop = True
install_command=python -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
# By default stestr will set concurrency
@ -123,7 +123,6 @@ commands = {posargs}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -fr doc/source/contributor/api/
@ -224,6 +223,7 @@ ignore-path=.tox,*.egg-info,doc/src/api,doc/source/drivers.rst,doc/build,.eggs/*
extension=.txt,.rst,.inc
[testenv:lower-constraints]
install_command=python -m pip install {opts} {packages}
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt