From 7cbe0375c965a17f8a76c443469be10b19b22e0d Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 06:24:19 +0200 Subject: [PATCH 1/2] pyheck: add build-pyheck.yml for riscv64 wheels Small pure-Rust PyO3/maturin string-case-conversion library (heck crate). abi3-py37, no native deps beyond rustup; validated locally by building the checkout with maturin and by rehearsing the full cibuildwheel job against manylinux_2_39_aarch64. --- .github/workflows/build-pyheck.yml | 100 +++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .github/workflows/build-pyheck.yml diff --git a/.github/workflows/build-pyheck.yml b/.github/workflows/build-pyheck.yml new file mode 100644 index 000000000..6cc7dc5ce --- /dev/null +++ b/.github/workflows/build-pyheck.yml @@ -0,0 +1,100 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `linux` job of +# https://github.com/kevinheavey/pyheck/blob/0.1.5/.github/workflows/build.yml +name: Build pyheck wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'pyheck version to build (git tag, e.g. 0.1.5)' + required: true + default: '0.1.5' + pull_request: + paths: + - '.github/workflows/build-pyheck.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '0.1.5' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + # `inputs.version` is empty on pull_request events; default to 0.1.5 there. + PYHECK_VERSION: ${{ inputs.version || '0.1.5' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_wheels: + needs: [setup] + name: Build pyheck ${{ inputs.version || '0.1.5' }} cp37-abi3-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + + steps: + - name: Checkout pyheck ${{ env.PYHECK_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: kevinheavey/pyheck + ref: ${{ env.PYHECK_VERSION }} + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + env: + # musllinux is dropped: rustup.rs ships no riscv64 musl toolchain. + # pyo3's abi3-py37 feature is on unconditionally (Cargo.toml), so + # one abi3 wheel serves every interpreter in our matrix; pyo3 + # 0.15.1 predates PEP 703 entirely, so there is no free-threaded + # (cp314t) job. + CIBW_BUILD: >- + cp312-manylinux_riscv64 cp313-manylinux_riscv64 + cp314-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # pyheck ships no [tool.cibuildwheel], so the Rust toolchain its + # maturin backend needs is installed in-container here. + CIBW_BEFORE_ALL_LINUX: >- + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_SOURCES: tests + CIBW_TEST_COMMAND: >- + python -c "import pyheck; assert pyheck.pyheck.__file__.endswith('.abi3.so'), pyheck.pyheck.__file__" && + python -m pytest -v tests + + - name: Check the licence made it into the wheel + run: | + python3 - wheelhouse/*.whl <<'EOF' + import sys, zipfile + for whl in sys.argv[1:]: + names = zipfile.ZipFile(whl).namelist() + # pyproject.toml pins maturin<0.13, which predates PEP 639 and + # uses dist-info/license_files/ instead of dist-info/licenses/. + assert any(n.endswith("dist-info/license_files/LICENSE") or n.endswith("dist-info/licenses/LICENSE") for n in names), names + print(whl, "ok") + EOF + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pyheck-${{ env.PYHECK_VERSION }}-cp37-abi3-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish pyheck ${{ inputs.version || '0.1.5' }} + needs: [setup, build_wheels] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: pyheck-${{ inputs.version || '0.1.5' }}-*-manylinux_riscv64 From 27efd97b52f909c673117f8edb59fcf5c48d5816 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 10:49:23 +0200 Subject: [PATCH 2/2] pyheck: bypass the pinned maturin<0.13 build backend on riscv64 pyproject.toml pins maturin<0.13, which has no riscv64 wheel on PyPI and fails to build from sdist because its own bootstrap assumes an ambient setuptools that Python 3.12+ no longer seeds into a build isolation venv. Install a current maturin (which builds this tree unmodified, confirmed locally) and skip isolation to bypass the pin. Verified with a full cibuildwheel rehearsal against manylinux_2_39_aarch64: build, licence check and pytest all pass. --- .github/workflows/build-pyheck.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-pyheck.yml b/.github/workflows/build-pyheck.yml index 6cc7dc5ce..47a5f77fb 100644 --- a/.github/workflows/build-pyheck.yml +++ b/.github/workflows/build-pyheck.yml @@ -65,6 +65,13 @@ jobs: CIBW_BEFORE_ALL_LINUX: >- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" + # pyproject.toml pins maturin<0.13 (2022), which has no riscv64 + # wheel on PyPI and fails to build from sdist (its own bootstrap + # needs setuptools, which Python 3.12+ no longer seeds into a + # fresh build-isolation venv). A current maturin builds this tree + # unmodified, so install one and skip isolation to bypass the pin. + CIBW_BEFORE_BUILD: pip install maturin + CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" CIBW_TEST_REQUIRES: pytest CIBW_TEST_SOURCES: tests CIBW_TEST_COMMAND: >- @@ -77,9 +84,7 @@ jobs: import sys, zipfile for whl in sys.argv[1:]: names = zipfile.ZipFile(whl).namelist() - # pyproject.toml pins maturin<0.13, which predates PEP 639 and - # uses dist-info/license_files/ instead of dist-info/licenses/. - assert any(n.endswith("dist-info/license_files/LICENSE") or n.endswith("dist-info/licenses/LICENSE") for n in names), names + assert any(n.endswith("dist-info/licenses/LICENSE") for n in names), names print(whl, "ok") EOF