Add support for free-threaded Python (PEP 703)#952
Open
Gaganraj2002 wants to merge 1 commit intopython-pendulum:masterfrom
Open
Add support for free-threaded Python (PEP 703)#952Gaganraj2002 wants to merge 1 commit intopython-pendulum:masterfrom
Gaganraj2002 wants to merge 1 commit intopython-pendulum:masterfrom
Conversation
Builds on python-pendulum#940 — completes the remaining work for free-threaded support. Rust: - Add `gil_used = false` to `#[pymodule]` (PyO3 0.27 defaults to true) - Codebase has zero global state, zero unsafe — all functions are pure CI (tests.yml): - Add 3.13t and 3.14t to test matrix - Skip mypy/typing deps for free-threaded builds (not yet compatible) CI (release.yml): - Add free-threaded wheel build step (3.13t/3.14t) in the build job - Skipped for PyPy matrix entries Tests: - Add concurrent thread-safety tests for parse, now, duration, diff, format
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.
Builds on #940 — this completes the remaining work for free-threaded Python support.
Changes
Rust (
rust/src/python/mod.rs):gil_used = falseto#[pymodule]declaration (PyO3 0.27 defaults totrue)unsafeblocks, and zerostaticvariables — all functions are pure computations, making it inherently thread-safeTest workflow (
.github/workflows/tests.yml):3.13tand3.14tto the test matrixRelease workflow (
.github/workflows/release.yml):--interpreter 3.13t 3.14t) in the build jobTests:
tests/test_thread_safety.pywith concurrent stress tests forparse,now,duration,diff, andformat(8 threads x 200 iterations each)Test plan
3.13tand3.14t