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: I3a9e4748c1cd7aad4c88809b9d3652471b7a3e0d
This commit is contained in:
Riccardo Pittau 2024-02-01 18:06:26 +01:00
parent a7f9492372
commit 5d217b7e84
1 changed files with 3 additions and 1 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}
@ -20,6 +21,7 @@ deps=
hacking~=6.0.0 # Apache-2.0
flake8-import-order>=0.17.1 # LGPLv3
pycodestyle>=2.0.0,<3.0.0 # MIT
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
commands = flake8 {posargs}
[testenv:venv]