Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-119132: Update sys.version to identify free-threaded or not.#119134
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
nineteendo commented May 18, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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 |
nineteendo commented May 18, 2024
You still need to update this: Lines 1156 to 1161 in 81c3130
|
nineteendo commented May 18, 2024
Currently this test is failing: cpython/Lib/test/test_platform.py Line 129 in 81c3130
Do you have an opinion on not including "default"? |
corona10 commented May 18, 2024
Hey, I am under testing. Would you like to leave a comment once I convert the PR into the official PR? |
nineteendo commented May 18, 2024
Old regex: ([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w]*)(?:,\s*([\w:]*))?)?\)\s*\[([^\]]+)\]?New regex: ([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w]*)(?:,\s*([\w:]*))?)(?:,\s*(free-threading))?\)*\s*\[([^\]]+)\]?Unmatched string: |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
corona10 commented May 18, 2024
@nineteendo Thanks for the comment Still issue (nah I am really bad at regex) |
vstinner commented May 18, 2024
I proposed a similar idea last August, but it was rejected at that time: #108239 |
vstinner commented May 18, 2024
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 |
corona10 commented May 18, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Then we need to discuss with @hugovk |
nineteendo commented May 18, 2024
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. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
corona10 commented May 18, 2024
@Yhg1s What do you think about backporting it into the 3.13 since it will help the free-threading ecosystem? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner left a comment
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 <vstinner@python.org>
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
GH-119153 is a backport of this pull request to the 3.13 branch. |
smontanaro commented May 19, 2024
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: |
gpshead commented May 19, 2024
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. |
smontanaro commented May 19, 2024
Thanks. Just checking. As long as there is somewhere to query the status at run-time without parsing a human-readable string. |
Uh oh!
There was an error while loading. Please reload this page.