Force constraints when installing a package during tox test

The tox deps option grants installation of single dependencies and
requirements, optionally pinned using constraints, before installing
a package, therefore not granting installation of the correct
constraint during the package installation.
To fix that tox 4.4.0 has introduced the constrain_package_deps
option [1]

[1] https://tox.wiki/en/4.12.1/faq.html#using-constraint-files

Change-Id: I14a93e67735df0f1b82dd687873ec77d8bfaac78
This commit is contained in:
Riccardo Pittau 2024-02-12 14:58:41 +01:00
parent 118da00f2f
commit 31ecf49b97
1 changed files with 4 additions and 2 deletions

View File

@ -1,10 +1,11 @@
[tox]
minversion = 3.18.0
minversion = 4.4.0
envlist = py3,pep8
ignore_basepython_conflict=true
[testenv]
basepython = python3
constrain_package_deps = true
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
@ -40,6 +41,7 @@ deps =
pycodestyle>=2.0.0,<3.0.0 # MIT
Pygments>=2.2.0 # BSD
doc8>=0.6.0 # Apache 2.0
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
commands =
flake8 {posargs}
doc8 README.rst doc/source --ignore D001
@ -81,4 +83,4 @@ deps = codespell
# note(adamcarthur): {posargs} lets us run `tox -ecodespell -- -w` to get codespell
# to correct spelling issues in our code it's aware of.
commands =
codespell {posargs}
codespell {posargs}