-
-
Notifications
You must be signed in to change notification settings - Fork 170
correctly match free-threaded python versions #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 wntrblm#949 which vaguely claims that free-threading is working, however this patch is needed if you actually want to indicate the Python version. Fixes: wntrblm#949
|
TIL I can also send the full executable name like |
|
ah it fails when we use pytest-xdist and run in separate processes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of #949, I think.
|
Thank you for fixing this! I had only used nox with projects that don't use any of the python environment setup features and just |
the workaround for [1] no longer works now that the fix has been committed. slightly surprising but just require that version of nox and carry on [1] wntrblm/nox#999 Change-Id: I4b4031c3d3d02399f55f9750237de61e5e90d179
includes fix for wntrblm/nox#999 Change-Id: Id38dc01a1fb8a7446e427a8cf9a0cae2db6c4a3b
includes fix for wntrblm/nox#999 Change-Id: Id38dc01a1fb8a7446e427a8cf9a0cae2db6c4a3b
the workaround for [1] no longer works now that the fix has been committed. slightly surprising but just require that version of nox and carry on [1] wntrblm/nox#999 Change-Id: I4b4031c3d3d02399f55f9750237de61e5e90d179 (cherry picked from commit e1f3b43)
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: #949