Enable maturin abi3 Python wheels#341
Merged
Merged
Conversation
a1eb44c to
26f5ac8
Compare
hayashi-mas-wap
requested changes
Jun 2, 2026
hayashi-mas-wap
approved these changes
Jun 2, 2026
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.
Summary
Move the SudachiPy extension build from setuptools-rust to maturin, build ABI-stable wheels for regular CPython 3.10+, keep version-specific free-threaded wheels for 3.13t/3.14t, and harden the wheel/sdist release workflow.
This PR now tests the full cibuildwheel matrix, including
cp313t/cp314twithtokenizersinstalled.What changed
pyproject.tomlusingmaturinas the PEP 517 backend.abi3-py310after the PyO3 0.28.3 update from Update PyO3 to 0.28.3 #334.cp310-abi3and free-threaded wheels ascp313-cp313t/cp314-cp314t.test_pretokenizers.pyrequiretokenizersagain, so pretokenizer coverage cannot silently disappear.python/verify-dist-artifacts.py.testpypi.uvand cibuildwheelbuild[uv].python/build_and_test.shagainst stale extension artifacts and Windowspython.exepath handling.tomlkit.__version__, and docs.manylinux_2_28Linux wheel baseline.Why this workflow shape
test-commandis intentional. cibuildwheel documents that this command tests each built wheel, and that the wheel is installed automatically and available for import during tests. It also says that withouttest-command, the wheel is not installed after building. That is why the wheel build runs import,unittest, andsudachipy --helpinstead of only producing artifacts. Reference: cibuildwheeltest-command.test-requires = ["sudachidict_core", "tokenizers"]is intentional. cibuildwheel documentstest-requiresas the dependencies installed before tests run. That keeps pretokenizer coverage active in wheel tests rather than depending on whatever happens to be present in the runner. Reference: cibuildwheeltest-requires.RUSTFLAGSoverride is deliberately narrow. cibuildwheel supports selector-based overrides andinherit.environment = "append", so the dynamic-lookup linker flags are applied only tocp3??t-macosx_*builds instead of changing Linux, Windows, or regular CPython wheels. Reference: cibuildwheel configuration overrides.pypiandtestpypi. Reference: Python Packaging User Guide: publishing with GitHub Actions.repository-url, not username/password secrets. PyPI’s Trusted Publisher docs show the TestPyPI form withrepository-url: https://test.pypi.org/legacy/, and the PyPA publish action documents the same input. References: PyPI Trusted Publishers: using a publisher and pypa/gh-action-pypi-publish.id-token: writeis only on publish jobs because OIDC needs it, but build/test jobs do not. GitHub documents thatid-token: writeis required to request the OIDC JWT and does not grant write access to other resources. The PyPA publish action also recommends setting it only in the publishing job and separating build from publish. References: GitHub OIDC reference and pypa/gh-action-pypi-publish Trusted Publishing notes.Maintainer notes
pyproject.tomlis intentional: maturin sdist includes cannot reference parent paths, so building from the repo root avoids symlink/copy staging hacks for the Rust workspace andresources/.enable = ["cpython-freethreading"]remains because cibuildwheel 3.4.1 still needs it for free-threaded identifiers.3.13tand3.14twheels are intentionally version-specific.tokenizers==0.23.1has macOScp310-abi3wheels, but macOS free-threaded test envs resolve it from sdist. The macOS free-threaded override adds-undefined dynamic_lookup, which fixes that source build without skipping tests.pypi.testpypi; noPYPI_TEST_USERNAME/PYPI_TEST_PASSWORDsecrets are used.Validation
2b5b0f83:verify distribution artifactspassed.upload-to-pypiskipped as expected because this was not a tag push.cp310,cp313t, andcp314tforx86_64,arm64, anduniversal2.sudachidict_coreandtokenizers==0.23.1beforetest-command.unittest discover, andsudachipy --helpfor free-threaded wheels, includingcp314t-macosx_universal2on both slices.verify-dist-artifacts.pypassed against CI artifacts and produced the full expected wheel matrix.PYTHON=python3.13t bash python/build_and_test.shpassed, 79 tests OK,tokenizersbuilt from source.PYTHON=python3.14t bash python/build_and_test.shpassed, 79 tests OK.bash python/build_and_test.shpassed on non-free-threaded Python 3.14, 79 tests OK with the free-threaded-only test skipped.cargo test --workspacepassed.cargo fmt --all --checkpassed.python3 python/check_version_consistency.pypassed.python -m build --sdistpassed.python3 -m py_compilepassed for changed Python files.