Skip to content

black: add build-black.yml for riscv64 wheels - #323

Merged
luhenry merged 1 commit into
mainfrom
black
Aug 24, 2026
Merged

black: add build-black.yml for riscv64 wheels#323
luhenry merged 1 commit into
mainfrom
black

Conversation

@luhenry

@luhenry luhenry commented Aug 24, 2026

Copy link
Copy Markdown
Member

Adds a riscv64 wheel build for black 26.5.1, published to pypi.riseproject.dev.

Ref #324

Shape

black publishes mypyc-compiled binary wheels (cpXY-cpXY, a big speedup) for common platforms but not riscv64 — the value-add here. It's a third mypyc variant on top of the ones already in the repo:

package backend mypyc trigger
tomli flit_core → setuptools swap script TOMLI_USE_MYPYC=1
mypy setuptools MYPY_USE_MYPYC=1
black hatch-mypyc build hook HATCH_BUILD_HOOKS_ENABLE=1

black ships a full [tool.cibuildwheel] config and bundles its tests, so this is the "easy inverse" (CLAUDE.md gotcha 6): we check out the tag and inherit that config wholesale — the hatch-mypyc hook, CC=clang (+ yum install -y clang), and upstream's own pytest {project} -k "not incompatible_with_mypyc" -n auto with the d/jupyter test-extras. The only override is CIBW_MANYLINUX_RISCV64_IMAGE.

Deliberately not setting CIBW_ENVIRONMENT: as an env var it replaces black's TOML [tool.cibuildwheel.environment] table rather than merging, which would silently drop HATCH_BUILD_HOOKS_ENABLE=1 and ship a pure-Python no-op. Not needed anyway — every runtime + test dep (aiohttp, ipython, …) already resolves from public PyPI.

Matrix

cp312 / cp313 / cp314 — per-interpreter (mypyc wheels aren't abi3). No free-threaded build: upstream skips it (cp31?t-*, "mypyc doesn't have great support for free threaded builds"), and PyPI confirms no cp313t/cp314t wheel.

Validation

  • YAML parses; actionlint clean (only the expected ubuntu-24.04-riscv unknown-label warning).
  • QEMU riscv64 (cibuildwheel --only cp312-manylinux_riscv64, aarch64 host): confirmed yum install -y clang succeeds on the image (clang 21.1.8) and the build's isolated env pulls in hatch-mypyc>=0.16.0 + mypy==1.20.2 — i.e. the compile hook is engaged, not a pure-Python fallback.
  • Version: shallow tag checkout → git describe yields a clean 26.5.1 (hatch-vcs), matching the canonical PyPI filename (no local segment).

black publishes mypyc-compiled wheels for common platforms but not riscv64.
Unlike tomli (flit-swap) or mypy (setuptools), black uses the hatch-mypyc
build hook, gated on HATCH_BUILD_HOOKS_ENABLE=1 in its committed
[tool.cibuildwheel] config. We check out the tag and inherit that config
wholesale (mypyc hook, CC=clang, the pytest suite, test-extras), overriding
only CIBW_MANYLINUX_RISCV64_IMAGE — every runtime and test dependency
(aiohttp, ipython, ...) already resolves from public PyPI.

Matrix is cp312/cp313/cp314; upstream skips free-threaded ("mypyc doesn't
have great support for free threaded builds"), so no cp314t.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@threexc

threexc commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

New issue to reference: #324

@luhenry luhenry linked an issue Aug 24, 2026 that may be closed by this pull request
@threexc

threexc commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

I don't want to make the workflows run again, but future commits could just do Ref: <issue_number> so that the issues we use have links to each relevant PR without closing/re-opening them each time.

@luhenry luhenry removed a link to an issue Aug 24, 2026
@luhenry
luhenry merged commit ebc72a8 into main Aug 24, 2026
7 checks passed
@luhenry
luhenry deleted the black branch August 24, 2026 16:28
@luhenry luhenry linked an issue Aug 24, 2026 that may be closed by this pull request
@luhenry

luhenry commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

@threexc I've updated Python Wheels to remove that behavior

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.

black riscv64 support

2 participants