-
Notifications
You must be signed in to change notification settings - Fork 284
feat: Support Python 3.14 free-threaded #1357
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
base: main
Are you sure you want to change the base?
Conversation
rust/cocoindex/Cargo.toml
Outdated
| [features] | ||
| default = ["legacy-states-v0"] | ||
| legacy-states-v0 = [] | ||
| legacy-states-v0 = [ "pyo3/abi3-py311"] |
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.
Let's enable this feature by default (just put it in pyo3 below). It doesn't belong to legacy-states-v0
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.
abi3-py311 now lives in a new abi3 feature which is part of default.
| default = ["legacy-states-v0"] | ||
| legacy-states-v0 = [] | ||
| legacy-states-v0 = [ "pyo3/abi3-py311"] | ||
| free-threaded = [] |
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.
Seems this one is not used anywhere.
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.
This feature now controls whether #[pymodule] is declared with gil_used = false.
| #[cfg_attr(feature = "free-threaded", pymodule(gil_used = false))] | ||
| #[cfg_attr(not(feature = "free-threaded"), pymodule)] |
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.
I think we don't need two branches here. We can always declare gil_used = false.
Based on the documentation, as long as our code is thread safe, we can use gil_used = false here. When it's declared false, both with-gil and thread-safe python can use it.
This PR adds Python 3.14 free-threaded mode support to CocoIndex, resolving #1187
Key Changes: