✨ feat(toml): declare factor group defaults and per-run overrides - #4050
Merged
Merged
Conversation
gaborbernat
force-pushed
the
feat-factor-group-default
branch
5 times, most recently
from
August 28, 2026 18:20
1484987 to
44e2dc6
Compare
A labeled factor group only existed as a bare list of values, so
{factor:label} had no answer outside the generated matrix and every use
site had to repeat {factor:label:fallback} to get one. Nothing let a run
try a value the matrix does not list either, which is what a one-off
check against a new dependency release needs.
A group can now be spelled as a table carrying `values` or a range plus
`default`, so the fallback lives with the declaration and is validated
against the group's own factors. TOX_FACTOR_<label> resolves a declared
label for one run without touching env names, keeping factor values
inside the naming scheme they belong to.
The label map now holds a FactorGroup rather than a bare list, so a
group's factors and its default travel together.
gaborbernat
force-pushed
the
feat-factor-group-default
branch
from
August 28, 2026 19:56
44e2dc6 to
374ed2e
Compare
gaborbernat
marked this pull request as ready for review
August 28, 2026 19:58
gaborbernat
enabled auto-merge (squash)
August 28, 2026 19:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4045 asks for two things: a default for a labelled factor group, so
{factor:label}does not need{factor:label:fallback}spelled out at every use site, and a way to run the matrix against a value it does not list, sketched there astox -f "django_version:'==6.0'"orTOX_F_django_version.The default half becomes a table form for a labelled group, carrying either
valuesor a range alongsidedefault:{ django_version = { values = ["django42", "django50"], default = "django50" } }. The default has to be one of the group's own factors, which is checked at load, so it can never resolve to a name no environment produces. It applies when no factor of the group is active in the current environment name, and a{factor:label:fallback}at the use site still wins over it.The injection half arrives as
TOX_FACTOR_<label>, read for labels the configuration declares.env TOX_FACTOR_django_version=django61 tox run -e django-py314-django50runs the environment the matrix generated while{factor:django_version}resolves todjango61. The literal syntax from the issue, a version specifier passed through-f, does not work in tox's model, since labelled factor values are environment-name components and>=4.2,<4.3cannot be one. Keeping the override out of the name sidesteps that, at the cost that the environment name no longer tells the whole story of a run.Closes #4045