Skip to content

Add support for Python Free-Threading#69

Merged
jborean93 merged 2 commits intomainfrom
free-threading
Nov 25, 2025
Merged

Add support for Python Free-Threading#69
jborean93 merged 2 commits intomainfrom
free-threading

Conversation

@jborean93
Copy link
Copy Markdown
Owner

Adds build support for Python Free-Threading (PEP 779). Wheels will be created for macOS and Linux will create a compatible extension binary if installed under a free-threaded enabled interpreter.

Adds build support for Python Free-Threading (PEP 779). Wheels will be
created for macOS and Linux will create a compatible extension binary if
installed under a free-threaded enabled interpreter.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds build and CI support for Python Free-Threading (PEP 779), enabling the library to create free-threading-compatible extension modules when built under a free-threaded Python interpreter (denoted by the "t" suffix, e.g., 3.14t). The changes focus on build-time detection and configuration rather than runtime thread-safety guarantees.

Key Changes:

  • Detection of free-threaded Python environments via sysconfig.get_config_var("Py_GIL_DISABLED") with automatic disabling of Limited API (which is incompatible with free-threading)
  • Conditional enabling of Cython's freethreading_compatible compiler directive when building under free-threaded Python
  • CI workflow additions to build and test Python 3.14t wheels for macOS (both x86_64 and arm64 architectures)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
setup.py Adds free-threading detection logic, disables Limited API for free-threaded builds, and conditionally enables Cython's freethreading_compatible directive
setup.cfg Adds Python Free Threading trove classifier indicating beta-level support
README.md Documents free-threading support, testing status, and platform-specific wheel availability with clarification about thread-safety limitations
CHANGELOG.md Records the addition of free-threading support for version 0.9.0
.github/workflows/ci.yml Adds macOS wheel builds and test matrix entries for Python 3.14t (free-threaded)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jborean93 jborean93 merged commit 8e2daf0 into main Nov 25, 2025
31 checks passed
@jborean93 jborean93 deleted the free-threading branch November 25, 2025 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants