Commit c804a04
authored
fix: correctly match free-threaded python versions (#999)
in the case where nox is run given an explicit python version
target to run on, nox locates Python interpreters by matching
that interpreter string to a regex, that is then expanded
to match the name of a Python executable by appending the
numeric portions of the version to the word "python", its
existence is verified with
shutil.which(), and is then passed off to virtualenv as a target
to use.
However, if the explicit python version ends in "t" for a free-threaded
python, such as "3.13t", the regex does not match, due to that
"t" that's present which isn't included in the regex.
This PR fixes the regex to also look for a "t" at the end for
a free-threaded version name, and formats it into the interpreter
name virtualenv will look for.
There's a bit of a secondary issue which is that if you are trying
to select for "3.13" non-free-threaded, but you have a free-threaded
3.13t in your path as well, that "python3.13" name matches in the
free-threaded bin folder as well, but virtualenv seems to know how
to make the right choice in this case.
The only issue I could find regarding free-threading is #949 which
vaguely claims that free-threading is working, however this
patch is needed if you actually want to indicate the Python version.
Fixes: #9491 parent a4b43d5 commit c804a04
2 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | | - | |
| 625 | + | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
| 629 | + | |
629 | 630 | | |
630 | 631 | | |
631 | 632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1097 | 1097 | | |
1098 | 1098 | | |
1099 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
1100 | 1102 | | |
1101 | 1103 | | |
1102 | 1104 | | |
| |||
0 commit comments