diff --git a/.github/workflows/build-bermuda.yml b/.github/workflows/build-bermuda.yml new file mode 100644 index 000000000000..13f84ac3ed11 --- /dev/null +++ b/.github/workflows/build-bermuda.yml @@ -0,0 +1,112 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on the `build_wheels` job of +# https://github.com/napari/bermuda/blob/v0.1.7/.github/workflows/wheels.yml +name: Build bermuda wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/bermuda.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-bermuda.yml' + - 'docs/packages/bermuda.yaml' + - 'patches/bermuda/**' + push: + branches: [main] + paths: + - '.github/workflows/build-bermuda.yml' + - 'docs/packages/bermuda.yaml' + - 'patches/bermuda/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + with: + package: bermuda + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build bermuda ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Per-interpreter (not abi3): pyo3's extension-module binding has no + # abi3 feature enabled here. + python: ["cp312", "cp313", "cp314", "cp314t"] + + env: + BERMUDA_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout bermuda v${{ env.BERMUDA_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: napari/bermuda + ref: v${{ env.BERMUDA_VERSION }} + persist-credentials: false + + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + persist-credentials: false + + - name: Patch bermuda source + run: git apply python-wheels/patches/bermuda/${{ env.BERMUDA_VERSION }}/*.patch + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + output-dir: wheelhouse/ + only: ${{ matrix.python }}-manylinux_riscv64 + env: + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # setuptools_scm can't derive the version from this tag-less checkout. + CIBW_ENVIRONMENT: >- + PATH=$HOME/.cargo/bin:$PATH + SETUPTOOLS_SCM_PRETEND_VERSION_FOR_BERMUDA=${{ env.BERMUDA_VERSION }} + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: bermuda-${{ env.BERMUDA_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish bermuda ${{ matrix.version }} + needs: [setup, build_wheels] + if: needs.setup.outputs.versions != '[]' + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + secrets: + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} + with: + artifact-pattern: bermuda-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/bermuda.yaml b/docs/packages/bermuda.yaml new file mode 100644 index 000000000000..b497fb830bc2 --- /dev/null +++ b/docs/packages/bermuda.yaml @@ -0,0 +1,5 @@ +package-name: bermuda +source-code: https://github.com/napari/bermuda +license: BSD-3-Clause +versions: +- version: 0.1.7 diff --git a/patches/bermuda/0.1.7/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch b/patches/bermuda/0.1.7/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch new file mode 100644 index 000000000000..a2b838448489 --- /dev/null +++ b/patches/bermuda/0.1.7/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Thu, 14 Oct 2026 12:00:00 +0000 +Subject: [PATCH] pyproject: drop the removed cpython-freethreading enable + group + +cibuildwheel 4.2.0 (the version this repo pins for riscv64 builds) no +longer recognises "cpython-freethreading" as an enable group -- it +errors "Failed to parse enable group" before any build starts, on +every interpreter, since the whole [tool.cibuildwheel] table is parsed +up front and `--only ` does not narrow around it. Free-threaded +builds (cp314t) no longer need an opt-in on this cibuildwheel version. + +Upstream-Status: Backport [https://github.com/napari/bermuda/commit/a73b76c35aabc693cd7996dfe66d8ead7dbb759f] +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 7f24c3b..7a8f083 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -163,7 +163,7 @@ combine-as-imports = true + [tool.cibuildwheel] + test-command = "pytest {project}/tests" + test-groups = ["test"] +-enable = ["pypy", "cpython-freethreading"] ++enable = ["pypy"] + build = "*64" + + [tool.cibuildwheel.linux]