Skip to content

Python 3.14 compatibility and chores - #16

Closed
dsbferris wants to merge 11 commits into
explosion:masterfrom
dsbferris:master
Closed

Python 3.14 compatibility and chores#16
dsbferris wants to merge 11 commits into
explosion:masterfrom
dsbferris:master

Conversation

@dsbferris

Copy link
Copy Markdown

Hi, I upgraded PyO3 to 0.29.0 to support Python 3.14. I did some required fixes and chores.

Notably, I had to remove the repo owner check from the test workflow, to be able to run it myself. You might want to drop that commit (b92d734).

Build and test workflows ran successfully, except for the macos-13 build. No clue why that one got stuck.

Cheers

@nkg

nkg commented Aug 26, 2026

Copy link
Copy Markdown

I needed cp314 support downstream, so I built and tested this branch. Sharing the results since CI hasn't run on the PR — everything below is on macOS arm64, CPython 3.14.4, Rust 1.96.0.

The pyo3 bump is necessary, not just housekeeping. Current master (pyo3 0.24.2) cannot build on 3.14 at all, even with a Rust toolchain present:

error: failed to run custom build command for `pyo3-ffi v0.24.2`
error: the configured Python interpreter version (3.14) is newer than
       [pyo3's maximum supported version]

Because there's no cp314 wheel, pip/uv fall back to the sdist, hit the above, and fail — so 3.14 users currently have no working path at all, not even "install a compiler".

This branch builds clean and passes:

$ uv build --wheel --python 3.14
Successfully built spacy_alignments-0.9.3-cp314-cp314-macosx_26_0_arm64.whl

$ python -m pytest --pyargs spacy_alignments -q
10 passed, 1 skipped

And it unblocks the wider stack. With that wheel available, a clean 3.14 environment resolves and imports the whole spaCy transformer chain:

python             : 3.14.4
spacy              : 3.8.16
spacy-transformers : 1.4.0
spacy-alignments   : 0.9.3
thinc              : 8.3.13
torch              : 2.13.0

spacy-transformers.TransformerModel.v3    : registered
spacy-transformers.TransformerListener.v1 : registered

get_alignments(['fou','gere'], ['fougere']) returns [[0], [0]] [[0, 1]] as expected.

Worth noting spacy-alignments is the only remaining cp314 gap in that chain — spacy, spacy-transformers, thinc 8.3.12+, blis, murmurhash, cymem, preshed, srsly and torch all already publish cp314 wheels. So this one package is what's holding 3.14 back for anyone using spacy-transformers.

Happy to help with anything that would move it along.

nkg added a commit to sproncy/spacy-alignments that referenced this pull request Aug 26, 2026
This fork exists for one reason: spacy-alignments has no cp314 wheel and
its sdist does not build on 3.14 either, because upstream pins pyo3 ^0.24
and pyo3-ffi 0.24.2 refuses to compile against 3.14. There is no working
path on 3.14, not even with a Rust toolchain, which blocks sproncy-ml and
therefore its sproncy-schemas pin.

Carries explosion#16 by @dsbferris — pyo3 ^0.24 -> ^0.29
plus the wheel matrix — with the Rust logic untouched.

Fork-specific changes:

- publish_pypi.yml removed. Inheriting it meant a tag in this repo would
  attempt to publish to the upstream spacy-alignments PyPI project, which
  must never happen from here. Deleting it is unambiguous in a way that
  relying on missing credentials is not.
- Matrix trimmed to ubuntu-latest and macos-14, the two platforms the
  fleet consumes.
- CIBW_BUILD limited to cp314-*. Upstream ships everything earlier, and
  duplicating those risks shadowing them.
- Releases published rather than drafted, since a draft is not
  downloadable by the CI that needs the wheels.

FORK.md records why this exists and, more importantly, when to delete it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CU37YPvKjxSWXHSZuDLDRn
@dsbferris

Copy link
Copy Markdown
Author

Closing this PR due to #17 containing all of this and more. Thanks @nkg for your additional investigation.

@dsbferris dsbferris closed this Aug 31, 2026
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