Repository navigation
✨ feat(spec): accept build suffixes on version specifiers - #176
Merged
gaborbernat merged 1 commit intoOct 30, 2026
Merged
Conversation
Specifiers now take the same trailing t, d/-dbg/-debug, -32/-64 and -<machine> parts as plain specs, once after the last item, so >=3.13t asks for a free-threaded 3.13 or newer. Both patterns share one modifier grammar so the two forms cannot drift apart again. A spec that starts with a comparison operator but does not parse now raises ValueError naming it, instead of being looked up as an executable. Closes tox-dev#175
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.
Since 1.6.6,
>=3.13tis looked up as an executable named>=3.13t(#175), so tools such as nox that let users writepython=">=3.13t"find nothing. Before 1.6.6 the spec parsed, but discovery raisedAssertionErroron the unreadable3.13titem, and under-Oit dropped thetand could pick a GIL build. ✨ Once this merges,>=3.13tasks for a free-threaded 3.13 or newer, and the other build suffixes work on ranges too:cpython>=3.11,<3.14-64asks for a 64-bit CPython in that range.Plain specs (
python3.13td-64-arm64) and specifiers now share one grammar for the trailing build modifiers:t,d/-dbg/-debug,-32/-64and-<machine>. On a specifier they follow the last item and apply to the whole set, the same place uv puts the variant in a--pythonrequest. Withoutta specifier still accepts any build, so existing ranges match the same interpreters as before.A spec that starts with a comparison operator but doesn't parse, such as
>=3.13.,>=3.x,>=3.12 <4(missing comma) or>=3.13t,<3.15(a flag on an inner item), now raisesValueErrornaming the spec. In 1.6.6 and 1.6.7 it became a literal executable name, which matched nothing and let a key list move on to the next entry. Callers that pass user input straight toget_interpreterorPythonSpec.from_string_specsee the error instead of a silent miss; wntrblm/nox#1217 handles unparsable ranges by checking for that literal-path result, so it needs to catch theValueErrorinstead.