✨ feat(toml): allow labeling a range factor group - #4049
Merged
gaborbernat merged 1 commit intoAug 28, 2026
Conversation
gaborbernat
force-pushed
the
feat-labeled-range-factor-group
branch
4 times, most recently
from
August 28, 2026 17:51
0f2e2d9 to
f9d7cee
Compare
Range factor groups were the only shape that could not carry a label, so
a Python version matrix written as a range had to be spelled out as an
explicit list before {factor:py_version} could reach it.
Nesting the range under a name reuses the labeled-dict shape already in
place for lists. That keeps one rule to learn, a single-key table names
the group, instead of adding a `label` key that only ranges would honor.
gaborbernat
force-pushed
the
feat-labeled-range-factor-group
branch
from
August 28, 2026 18:19
f9d7cee to
a973934
Compare
gaborbernat
marked this pull request as ready for review
August 28, 2026 19:53
This was referenced Aug 28, 2026
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.
Factor groups come in three shapes, and only two of them could be named. A list gains a label by nesting it under one,
{ django_version = ["django42", "django50"] }, but a range dict had no equivalent, so anyone wanting{factor:py_version}over a generated Python range had to abandon the range and write the versions out by hand (#4046).A labeled group now accepts a range dict as its value, so
{ py_version = { prefix = "3.", start = 12, stop = 14 } }both expands to3.12,3.13,3.14and registerspy_versionfor substitution. Reusing the existing single-key-table shape keeps one rule for naming a group, rather than adding alabelkey that only range dicts would honor. The same form works inenv_basefactors and inenv_listproduct groups.A labeled group whose value is a table without
prefixis rejected with a message naming the label, since that table cannot be a range and would otherwise expand to nothing.