Conversation
mypy compiles itself with mypyc and ships per-interpreter compiled wheels on PyPI for every platform except riscv64. Add build-mypy.yml to build the riscv64 ones, mirroring upstream's recipe in mypyc/mypy_mypyc-wheels (cibuildwheel.toml): MYPY_USE_MYPYC=1 opt-in, MYPYC_OPT_LEVEL=3, and the full mypy.test + mypyc.test suites (minus test_external) run against the compiled wheel. The two mypyc-specific deps (librt, ast-serialize) already ship public-PyPI riscv64 wheels, so no registry index is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds
.github/workflows/build-mypy.ymlto build riscv64 mypyc-compiled wheels for mypy 2.3.1 and publish them topypi.riseproject.dev. mypy ships per-interpreter compiled wheels on PyPI for every platform except riscv64 (only the slowpy3-none-anyfallback is available there).mypy is the canonical mypyc package — it compiles itself. This mirrors upstream's own wheel recipe from
mypyc/mypy_mypyc-wheels'scibuildwheel.toml, with riscv64 overrides.Shape
build-tomli.yml), matrix[cp312, cp313, cp314, cp314t]— mypyc emits per-interpreter (non-abi3) wheels.setuptools.build_meta, so there's no flit→setuptools backend swap and no host-side script — the job is just checkout → cibuildwheel → upload.MYPY_USE_MYPYC=1(setup.py); without it the build silently ships a pure-Python wheel, so it's load-bearing.MYPYC_OPT_LEVEL=3matches upstream's shipped wheels.librt,ast-serialize) already ship public-PyPI riscv64 wheels; the rest are pure-Python.--exclude— the compiled wheel vendors nothing (librt stays a runtime pip dep).test-requirements.txt, then runsmypy.test+mypyc.test(minustest_external) against the installed compiled wheel.Validated before push
End-to-end on native aarch64 (cp312, manylinux_2_28), single-file
-O3— the config this PR ships:.so(matches upstream exactly), 14.5 MB, zero vendored.libs/.librt 0.13.0,ast-serialize 0.6.0,lxml 6.1.0,psutil) resolved from public PyPI.CIBW_TEST_COMMANDplumbing runs pytest against the installed compiled wheel from a temp cwd — 1505 passed, 2 skipped, 3 xfailed, 0 failed on a testcheck+test_run slice.actionlintclean (only the expectedubuntu-24.04-riscvunknown-label warning).Notes for reviewers
-O3even on fast native aarch64; the riscv runner is slower, so the build job carriestimeout-minutes: 720(repo precedent: torch's riscv job uses 1440).MYPYC_MULTI_FILE=1was tested and is worse (sequential per-file compile, no-j), so single-file (upstream's Linux default) is kept.publishjob dry-runs offmain, so it's safe on this PR branch.🤖 Generated with Claude Code