-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-119132: Update sys.version to identify free-threaded or not. #119134
Conversation
corona10
commented
May 17, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Python -VV should display whether the build is default build or free-threading. #119132
Could we maybe leave out "default" for the normal build? It doesn't really add value:
The tests on GitHub don't include "(default)" either. Maybe even like this:
This could even work for
|
You still need to update this: Lines 1156 to 1161 in 81c3130
|
Currently this test is failing: cpython/Lib/test/test_platform.py Line 129 in 81c3130
Do you have an opinion on not including "default"? |
Hey, I am under testing. Would you like to leave a comment once I convert the PR into the official PR? |
Old regex: ([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]? New regex: ([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)(?:,\s*(free-threading))?\)*\s*\[([^\]]+)\]? Unmatched string:
|
Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Nice Zombies <[email protected]>
@nineteendo Thanks for the comment Still issue (nah I am really bad at regex)
|
I proposed a similar idea last August, but it was rejected at that time: #108239 |
I suggest to mention The "(...)" part of sys.version is the Git information, I would prefer to not touch it. If we change sys.version, I would prefer to "add a new field" in sys.version. For example, add
The drawback of changing |
Then we need to discuss with @hugovk |
You accidentally added -([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?(?:,\s*(free-threading))?\)*\s*\[([^\]]+)\]?
+([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?(?:,\s*(free-threading))?\)\s*\[([^\]]+)\]? But I would prefer a new field as well. |
@Yhg1s What do you think about backporting it into the 3.13 since it will help the free-threading ecosystem? |
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.
LGTM, but see my comment on regex.
Co-authored-by: Victor Stinner <[email protected]>
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…pythongh-119134) (cherry picked from commit c141d43) Co-authored-by: Donghee Na <[email protected]>
GH-119153 is a backport of this pull request to the 3.13 branch. |
Sorry, I haven't been paying close attention, but was there a decision not to tweak
It seems that since it's a named tuple there'd be little problem adding a new field which distinguishes the two builds. Something like:
|
build information is not part of version_info. the version string is meant for humans and includes other detailed things that are also not in version_info such as compiler details. there's the https://docs.python.org/3.13/library/sys.html#sys._is_gil_enabled may-change-in-the-future API for people wanting to know the current status of the GIL regardless of build type. |
Thanks. Just checking. As long as there is somewhere to query the status at run-time without parsing a human-readable string. |