-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
Add free-threaded Python support #2310
Conversation
This change is part of the following stack: Change managed by git-spice. |
103c93d
to
4c1e000
Compare
For testing it's possible to use https://github.com/Quansight-Labs/setup-python as a drop-in replacement for the GitHub one |
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.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.
Comments skipped due to low confidence (1)
src/python_interpreter/config.rs:131
- The handling of abiflags for free-threaded Python on Windows is incomplete. This could lead to unexpected behavior if free-threaded Python is used on Windows.
// FIXME: windows abiflags for free-threaded python?
ffbf35a
to
ba5b918
Compare
Happy to help with this if needed. The windows free-threaded packaging situation is "fun". |
dd2379a
to
ae896ff
Compare
Thanks, feel free to send PR to this branch! |
ae896ff
to
22add66
Compare
It looks like a few of the tests hardcode using abi3:
Since free-threading and abi3 are incompatible, would it be better to skip over the tests that use these crates? For the ones that are testing whether the limited api support is working correctly I think skipping them makes sense, but some of these seem to be more generic integration tests for maturin that happen to use the limited API. I don't see an easy way to optionally turn on and off the abi3 feature in the test crates. Am I missing something? If not, any guidance? |
We should probably try to support this case because My gut says that it'd be good enough for now if |
Hmm, that's sort of in the vein of PyO3/pyo3#4719, but maybe what I'm doing there making more things hard errors is bad and it would be better to warn and just turn off limited API and set the ABI to Py_3_13 if someone is trying to build for the free-threaded ABI but asks for an earlier ABI. |
We have a convoluted setup where |
👍 It seems to me that we probably don't want |
Yep, if I add |
It looks like three of the crates use old PyO3 APIs and need to be updated:
Other errors from trying to build one of these crates:
I'm confused why the update to PyO3 0.23 last week didn't break tests using these crates on CI. |
9c7dc83
to
417eb38
Compare
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.
Copilot reviewed 5 out of 8 changed files in this pull request and generated no suggestions.
Files not reviewed (3)
- src/auditwheel/audit.rs: Evaluated as low risk
- src/build_options.rs: Evaluated as low risk
- src/cross_compile.rs: Evaluated as low risk
Some of these tests are not built but only used to test generating source distribution, will fix them later in a separate PR. |
Implementation details:
Py_GIL_DISABLED
build flag for runnable Python interpreterspython3.13t
when cross compilingCloses #2298
Closes #2315