-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Declare free-threaded support for PyModule (#4588)
* WIP: declare free-threaded support in pymodule macro * ignore ruff lint about unused import * eliminate gil re-enabling in pytests * fix clippy nit * fix return type of PyUnstable_Module_SetGIL binding * add a way to declare free-threaded support without macros * fix ruff * fix changed ui test answer * fix build issues on old python versions * fix runtime warnings in examples * ensure that the GIL does not get re-enabled in the pytests * add changelog entry * fix ruff * fix compiler error on older pythons * fix clippy * really fix clippy and expose supports_free_threaded on all builds * fix clippy and msrv * fix examples on gil-disabled python * fix free-threaded clippy * fix unused import in example * Add pyo3-build-config as a build dependency to examples that need it * add docs * add rust tests so coverage picks up the new code * fix some formatting issues * Apply cleanups * fix cargo fmt --check * revert changes to non-FFI examples * apply David's suggestion for the guide * link to raw FFI examples in the guide * fix config guards in moduleobject.rs * rename supports_free_threaded to gil_used * remove ensure_gil_enabled from pyo3-ffi/build.rs * update docs for PyModule::gil_used * remove UNSAFE_PYO3_BUILD_FREE_THREADED from the CI config * fix merge conflict screwup * fix nox -s test-py * fix guide links * remove redundant pytest test * fix issue with wrap_pymodule not respecting user choice for GIL support * replace map.unwrap_or with map_or * fix refcounting error in ffi example
- Loading branch information
Showing
34 changed files
with
288 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* It is now possible to declare that a module supports the free-threaded build | ||
by either calling `PyModule::gil_used` or passing | ||
`gil_used = false` as a parameter to the `pymodule` proc macro. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
pyo3_build_config::use_pyo3_cfgs(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
pyo3_build_config::use_pyo3_cfgs(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.