Skip to content

Add Python 3.14/3.14t support and Cython 3.3 - #9

Open
jlevy wants to merge 2 commits into
rapidfuzz:mainfrom
jlevy:add-python-3.14-cython-3.3
Open

jlevy wants to merge 2 commits into
rapidfuzz:mainfrom
jlevy:add-python-3.14-cython-3.3

Conversation

@jlevy

@jlevy jlevy commented Sep 19, 2026

Copy link
Copy Markdown

I have some downstream projects that use cydifflib and it would be great if I can support 3.14 properly.
Rest of the description and code changes are agent written.
I added a little modernization with uv and an AGENTS.md but tried to keep changes otherwise minimal.
—Josh

Summary

Already in place and unchanged:

  • 3.9+ drop-in for stdlib difflib, with no runtime dependencies
  • scikit-build-core + CMake
  • sdist without Cython after generate + tools/sdist.patch
  • pip/cibuildwheel as the published path

This PR adds 3.14 and free-threaded 3.14t support and the Cython / concurrency work those builds require.

Problem

  • No 3.14 or free-threaded 3.14t wheels.
  • Cython was >=3.0.12,<3.1.0. 3.14t does not compile on Cython 3.0.x.
  • No # cython: freethreading_compatible=True, so a 3.14t import re-enables the GIL.
  • No documented or tested concurrency contract. SequenceMatcher scratch is per-instance; sharing one matcher across threads is unsupported (same as stdlib). HtmlDiff._default_prefix is process-wide.
  • Local uv workflow was not set up (optional; not a user-facing break).

Changes

  • Cython >=3.3.0,<3.4 (build-only); scikit-build-core >=1.0; CMake max 3.30.
  • freethreading_compatible=True pragma; HtmlDiff._default_prefix lock; docs; tests/test_concurrency.py.
  • Wheel matrix includes 3.14/3.14t with cibuildwheel 4.2.1 and small portability fixes (3.9 zip without strict=, skip thread tests when threads cannot start, Windows ARM64 delvewheel exclude MSVC CRT); Intel Mac CI uses macos-15-intel because macos-13 runners are retired.
  • Optional local uv (uv.toml / uv.lock); no .python-version; AGENTS.md is contributor docs only.
  • The sdist job installs the Cython-stripped tarball and runs pytest.

Compatibility

  • Python 3.9+ and the public API are unchanged.
  • Optional uv does not change pip, conda, thefuzz, PyPy, or sdist-without-Cython. CI stays on pip.

Dependencies

  • Runtime: none.
  • Build: Cython and scikit-build-core bumps (cmake/ninja stay out of build-system.requires).
  • Dev: optional pytest>=8.

Test plan

  • Local pytest on 3.10, 3.11, 3.12, 3.13, 3.14, and 3.14t.
  • Isolated wheel build.
  • CI matrix including 3.14/3.14t.

Made with Cursor

jlevy and others added 2 commits September 18, 2026 23:57
## Summary

Already in place and unchanged:

- 3.9+ drop-in for stdlib `difflib`, with no runtime dependencies
- scikit-build-core + CMake
- sdist without Cython after generate + `tools/sdist.patch`
- pip/cibuildwheel as the published path

This PR adds 3.14 and free-threaded 3.14t support and the Cython / concurrency work those builds require.

## Problem

- No 3.14 or free-threaded 3.14t wheels.
- Cython was `>=3.0.12,<3.1.0`. 3.14t does not compile on Cython 3.0.x.
- No `# cython: freethreading_compatible=True`, so a 3.14t import re-enables the GIL.
- No documented or tested concurrency contract. `SequenceMatcher` scratch is per-instance; sharing one matcher across threads is unsupported (same as stdlib). `HtmlDiff._default_prefix` is process-wide.
- Local uv workflow was not set up (optional; not a user-facing break).

## Changes

- Cython `>=3.3.0,<3.4` (build-only); scikit-build-core `>=1.0`; CMake max 3.30.
- `freethreading_compatible=True` pragma; `HtmlDiff._default_prefix` lock; docs; `tests/test_concurrency.py`.
- Wheel matrix includes 3.14/3.14t with cibuildwheel 4.2.1 and small portability fixes (3.9 `zip` without `strict=`, skip thread tests when threads cannot start, Windows ARM64 delvewheel exclude MSVC CRT); Intel Mac CI uses macos-15-intel because macos-13 runners are retired.
- Optional local uv (`uv.toml` / `uv.lock`); no `.python-version`; `AGENTS.md` is contributor docs only.

## Compatibility

- Python 3.9+ and the public API are unchanged.
- Optional uv does not change pip, conda, thefuzz, PyPy, or sdist-without-Cython. CI stays on pip.

## Dependencies

- Runtime: none.
- Build: Cython and scikit-build-core bumps (cmake/ninja stay out of `build-system.requires`).
- Dev: optional `pytest>=8`.

## Test plan

- Local pytest on 3.11, 3.12, 3.13, 3.14, and 3.14t.
- Isolated wheel build.
- CI matrix including 3.14/3.14t.
Wheel jobs already install each tag and run the test suite; the sdist job
only compiled. Match RapidFuzz’s install-then-pytest step and document
which cibuildwheel skips stay build-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant