Skip to content

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

Merged
jlevy merged 5 commits into
add-python-3.14-cython-3.3from
modern-uv-build
Sep 19, 2026
Merged

jlevy merged 5 commits into
add-python-3.14-cython-3.3from
modern-uv-build

Conversation

@jlevy

@jlevy jlevy commented Sep 19, 2026

Copy link
Copy Markdown
Owner

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.

jlevy and others added 3 commits September 18, 2026 22:48
Mark the extension free-threading compatible (one SequenceMatcher per thread).

Co-authored-by: Cursor <cursoragent@cursor.com>
cibuildwheel 4.2.1 rejects cpython-freethreading; 3.14t is default and pypy-eol keeps pp39/pp310.

Co-authored-by: Cursor <cursoragent@cursor.com>
zip(strict=True) is 3.10-only; Pyodide cannot start threads; and
cross-built ARM64 wheels cannot vendor the x64 MSVC CRT from the runner.

Co-authored-by: Cursor <cursoragent@cursor.com>
Repository owner deleted a comment from cursor Bot Sep 19, 2026
Repository owner deleted a comment from cursor Bot Sep 19, 2026
Repository owner deleted a comment from cursor Bot Sep 19, 2026
…default.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jlevy jlevy changed the title Add Python 3.14/3.14t and Cython 3.3 (keep 3.9+ wheels) Add 3.14/3.14t support and Cython 3.3, keep 3.9+ drop-in wheels Sep 19, 2026
Repository owner deleted a comment from cursor Bot Sep 19, 2026
@jlevy jlevy changed the title Add 3.14/3.14t support and Cython 3.3, keep 3.9+ drop-in wheels Add Python 3.14/3.14t support and Cython 3.3 Sep 19, 2026
@jlevy
jlevy requested a lite review from Copilot September 19, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Fix the missing dynamic-version regex and enable cibuildwheel free-threading for cp314t builds.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Adds Python 3.14/3.14t support, upgrades Cython, and improves free-threading documentation and testing.

Changes:

  • Updates build metadata, CMake compatibility, and wheel CI.
  • Adds concurrency support, locking, and tests.
  • Adds local development configuration and documentation.
File Summary
uv.toml Adds local uv configuration.
uv.lock Adds development dependency lockfile.
tools/​sdist.patch Updates the sdist build patch.
tests/​test_concurrency.py Adds concurrency and free-threading tests.
src/​cydifflib/​_initialize.pyx Adds free-threading compatibility and locking.
README.md Documents development and concurrency behavior.
pyproject.toml Updates build metadata and Python support.
CMakeLists.txt Updates CMake compatibility.
CLAUDE.md References contributor instructions.
CHANGELOG.md Documents the unreleased changes.
AGENTS.md Adds contributor build guidance.
.gitignore Ignores local build artifacts.
.github/​workflows/​build.yml Updates CI tooling and wheel targets.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pyproject.toml
Comment on lines +59 to 62
[[tool.dynamic-metadata]]
provider = "scikit_build_core.metadata.regex"
field = "version"
input = "src/cydifflib/__init__.py"
Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Sep 19, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_a4f0cc63-a97a-4c93-a42e-5aa8a571c3a8)

@jlevy
jlevy changed the base branch from main to add-python-3.14-cython-3.3 September 19, 2026 06:57
@jlevy
jlevy merged commit 6fc166f into add-python-3.14-cython-3.3 Sep 19, 2026
81 of 83 checks passed
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