✨ enable free-threaded Python 3.14t support#23
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
=======================================
Coverage 94.71% 94.71%
=======================================
Files 16 16
Lines 1249 1249
=======================================
Hits 1183 1183
Misses 66 66 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Remove PyErr_CheckSignals() calls from include/warps.h to support no-GIL execution. This tradeoff loses Ctrl+C interruptibility during long ITK operations but enables the pybind11 module to run safely without the GIL. - Use PYBIND11_MODULE_GIL_NOT_USED() in src/warpkit.cpp - Remove all 12 PyErr_CheckSignals() calls from include/warps.h - Update pyproject.toml [tool.cibuildwheel] to allow cp314t-* builds - Update CLAUDE.md CI section to reflect free-threaded support
Reintroduce PyErr_CheckSignals() in include/warps.h behind a WARPKIT_CHECK_SIGNALS() macro that compiles to a no-op when Py_GIL_DISABLED is defined. GIL builds regain Ctrl+C interruptibility during long ITK operations; the free-threaded build still skips the GIL-requiring check.
There was a problem hiding this comment.
Pull request overview
This PR adds CI coverage for Python 3.14 free-threaded (“no-GIL”) builds by splitting the wheel build matrix into standard cp314-* and free-threaded cp314t*, and updating the extension code/config to better tolerate no-GIL builds.
Changes:
- Update GitHub Actions wheel matrix to build/test both
cp314-*andcp314t*wheels. - Enable
cp314t-*builds in cibuildwheel by removing them from the skip list. - Adjust the C++ extension for free-threaded builds by declaring
py::mod_gil_not_used()and guardingPyErr_CheckSignals()behind a macro that becomes a no-op underPy_GIL_DISABLED.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/warpkit.cpp |
Declares the module as mod_gil_not_used() to opt into free-threaded behavior. |
include/warps.h |
Introduces WARPKIT_CHECK_SIGNALS() to avoid PyErr_CheckSignals() under Py_GIL_DISABLED. |
pyproject.toml |
Removes cp314t-* from cibuildwheel’s skip list so free-threaded wheels can build. |
.github/workflows/build.yml |
Splits Python 3.14 builds into cp314-* and cp314t* matrix entries. |
CLAUDE.md |
Updates CI documentation to reflect free-threaded wheel support and the new signal-check behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enables free-threaded (no-GIL) Python 3.14t wheels alongside the standard build matrix, while preserving Ctrl+C interruptibility on regular GIL builds.
Changes
cp314*glob intocp314-*(standard) andcp314t*(free-threaded) matrix entries, so each is reported as its own job.[tool.cibuildwheel].skipnow only excludes*musllinux*;cp314t-*is built on every supported OS.py::mod_gil_not_used()on the module (pybind11 3.0+ syntax) so CPython does not re-enable the GIL when the extension loads under a free-threaded interpreter.PyErr_CheckSignals()site in a newWARPKIT_CHECK_SIGNALS()macro that compiles to a no-op whenPy_GIL_DISABLEDis defined. GIL builds keep Ctrl+C interruptibility during long ITK operations; the free-threaded build skips the GIL-requiring check.Test plan
uv run pytest -q(210 passed),uvx ruff check,uvx ruff format --check,uvx pyrightclean