Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tox.ini: Fix Python environment factors
Tox's default nomenclature for referring to Python test environments (without further config options) follows the 'py3[[:digit:]]*' expression, in other words if one wants to run tests against Python 3.9, they'd put 'py39' in the 'envlist' setting, similarly for py310, py311, etc. We didn't follow the rules and so we always executed tox against the Python version that was originally used to create the development virtual environment. This is proved by the tox's output which reports: python3.10: install_deps> python -I -m pip install -r requirements-extras.txt ... =========================================================== platform linux -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0 despite having been instructed (though in an incorrect way) to run a Python 3.10 environment. This behaviour also silently ignored cases where the given Python version wasn't even installed on the system, so the platform Python which was used to create the virtual environment was always used. After this patch, this is what the execution reports: py310: install_deps> python -I -m pip install -r requirements-extras.txt .pkg-cpython310: install_requires> python -I -m pip install setuptools setuptools-scm ... ============================================================ platform linux -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0 AND py310: skipped because could not find python interpreter with spec(s): py310 if python3.10 isn't installed on the host system. While at it, use Bash-like brace expansion to cover a range of minor Python 3 versions instead of explicitly enumerating each one of them. Signed-off-by: Erik Skultety <[email protected]>
- Loading branch information