Repository navigation
π fix(config): don't read dashed version factors as a range - #4380
Merged
Merged
Conversation
Outside braces, a pair of numbers after a dash, as in py-django-4-2, split the env into py-django-4, 3 and 2. Braced ranges such as py-django-{4-5} still expand.
ericdelorefice
force-pushed
the
fix-dashed-range-factor
branch
from
November 4, 2026 15:57
f88a41c to
c948ee2
Compare
ericdelorefice
marked this pull request as ready for review
November 4, 2026 16:58
The new lookbehind also applies inside braces, so {py-1-3,x} stays as
written. The regex comment said the rule held outside braces, and the
docs said a range opens wherever a factor starts, which stopped being
true once a factor after a dash could no longer open one. Both now say a
range opens only where an environment or a brace item starts. Pin the
brace case in tests.
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.
An
env_listthat spells a version with dashes, such aspy-django-4-2, py-django-5-0, was split into made-up environments (py-django-4,3,2) without any warning, and which entry broke depended on the order of the list. π Such names now stay one environment, whether they come fromenv_list,-eon the command line, or a factor condition.Range expansion now recognizes a range only where an environment name or a brace item starts. #4053 already kept digits that continue a name, as in
django4-2, out of ranges; this applies the same rule to digits after a-. Braced ranges, the only form documented since ranges arrived in #3503, keep expanding:py-django-{4-5}still givespy-django-4andpy-django-5.An unbraced range after a dash, such as
py-1-3or{py-1-3,x}, no longer expands. Neither form was documented, and both produced broken names before:{py-1-3,x}becamepy-1,2,3andx. The configuration reference now says where a range may start and shows the braced form to use after a-.I used Claude Code to help with this; I've checked and can explain every line.
tox -e fix)docs/changelogfragment for user-facing changes, or appliedskip newstox run -e 3.11,3.15)