How can I set a testenv that specifies settings for a specific Python version? As a minimal example,
[tox]
envlist = py{36,37,38,39}-{mylinux,macos,mywindows}
skipsdist = True
[testenv]
platform = mylinux: linux
mymacos: darwin
mywindows: win32
setenv =
mylinux: PLATFORM = linux
mymacos: PLATFORM = macos
mywindows: PLATFORM = windows
commands =
{envpython} -c "print('{env:PLATFORM}')" # This env is used in setup.py
# other commands
[testenv:py36]
deps =
pydantic # No dataclasses until py37
If I run tox -e py36-mylinux, pydantic won't be installed. If I run tox -e py36, it would say
ERROR: py36: unresolvable substitution(s):
commands: 'PLATFORM'
Environment variables are missing or defined recursively.
How can I specify testenv settings for a particular Python version, without having to specify all other info in environment names (especially when the envlist gets long)?