From 1b32dad7acf0a9a1b9c339b7493f0f1b7c56d920 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 15:34:46 +0200 Subject: [PATCH 1/3] fabio: add build-fabio.yml for riscv64 wheels --- .github/workflows/build-fabio.yml | 125 ++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 .github/workflows/build-fabio.yml diff --git a/.github/workflows/build-fabio.yml b/.github/workflows/build-fabio.yml new file mode 100644 index 000000000..7b439c44c --- /dev/null +++ b/.github/workflows/build-fabio.yml @@ -0,0 +1,125 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on upstream's own wheel builder: +# https://github.com/silx-kit/fabio/blob/v2026.06/.github/workflows/release.yml +name: Build fabio wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'fabio version to build (git tag without leading v, e.g. 2026.06)' + required: true + default: '2026.06' + pull_request: + paths: + - '.github/workflows/build-fabio.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '2026.06' }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read # to fetch code (actions/checkout) + +env: + FABIO_VERSION: ${{ inputs.version || '2026.06' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_sdist: + needs: [setup] + name: Build fabio ${{ inputs.version || '2026.06' }} sdist + runs-on: ubuntu-latest + outputs: + sdist_name: ${{ steps.sdist.outputs.sdist_name }} + package_version: ${{ steps.sdist.outputs.package_version }} + steps: + - name: Checkout fabio v${{ env.FABIO_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: silx-kit/fabio + ref: v${{ env.FABIO_VERSION }} + persist-credentials: false + + - name: Install Python + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 + with: + python-version: '3.12' + activate-environment: true + enable-cache: false + + - name: Build sdist + id: sdist + run: | + uv pip install build twine + python -m build --sdist + twine check dist/* + sdists=(dist/*.tar.gz) + sdist_name="$(basename "${sdists[0]}")" + echo "sdist_name=${sdist_name}" >> "$GITHUB_OUTPUT" + echo "package_version=$(echo "${sdist_name}" | sed -En 's/fabio-(.+)\.tar\.gz/\1/p')" >> "$GITHUB_OUTPUT" + + - name: Upload sdist artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: fabio-${{ env.FABIO_VERSION }}-sdist + path: dist/*.tar.gz + if-no-files-found: error + + build_wheels: + needs: [setup, build_sdist] + name: Build fabio ${{ inputs.version || '2026.06' }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + # Matches upstream's own release.yml CIBW_BUILD (cp311-cp314; no cp314t). + python: ["cp311", "cp312", "cp313", "cp314"] + + steps: + - name: Download sdist + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: fabio-${{ env.FABIO_VERSION }}-sdist + path: dist/ + + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + package-dir: dist/${{ needs.build_sdist.outputs.sdist_name }} + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_ENVIRONMENT_LINUX: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + # hdf5plugin (a hard runtime dep) has no riscv64 wheel and its sdist + # vendors a large set of its own compression libraries - a separate + # port in its own right. Keep the wheel install bare and pre-install + # what the test suite actually exercises instead (gotcha 122). PySide6 + # is dropped too: no riscv64 wheel, and nothing under fabio/test + # imports it - only the unrun fabio_viewer app does. + CIBW_TEST_ENVIRONMENT: PIP_NO_DEPS=1 + CIBW_BEFORE_TEST_LINUX: >- + PIP_NO_DEPS=0 pip install --prefer-binary numpy h5py lxml pillow filelock qtpy matplotlib + CIBW_TEST_COMMAND: python -c "import fabio.test, sys; sys.exit(fabio.test.run_tests())" + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: fabio-${{ needs.build_sdist.outputs.package_version }}-${{ matrix.python }}-manylinux_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish fabio ${{ inputs.version || '2026.06' }} + needs: [setup, build_sdist, build_wheels] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: fabio-${{ needs.build_sdist.outputs.package_version }}-*-manylinux_riscv64 From e5e0a79da7d283638c5990c8bd34482b3850136e Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 15:59:02 +0200 Subject: [PATCH 2/3] fabio: skip the Qt-dependent test_import module (no riscv64 Qt binding) --- .github/workflows/build-fabio.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-fabio.yml b/.github/workflows/build-fabio.yml index 7b439c44c..ad61676fc 100644 --- a/.github/workflows/build-fabio.yml +++ b/.github/workflows/build-fabio.yml @@ -100,13 +100,17 @@ jobs: # hdf5plugin (a hard runtime dep) has no riscv64 wheel and its sdist # vendors a large set of its own compression libraries - a separate # port in its own right. Keep the wheel install bare and pre-install - # what the test suite actually exercises instead (gotcha 122). PySide6 - # is dropped too: no riscv64 wheel, and nothing under fabio/test - # imports it - only the unrun fabio_viewer app does. + # what the test suite actually exercises instead (gotcha 122). CIBW_TEST_ENVIRONMENT: PIP_NO_DEPS=1 CIBW_BEFORE_TEST_LINUX: >- - PIP_NO_DEPS=0 pip install --prefer-binary numpy h5py lxml pillow filelock qtpy matplotlib - CIBW_TEST_COMMAND: python -c "import fabio.test, sys; sys.exit(fabio.test.run_tests())" + PIP_NO_DEPS=0 pip install --prefer-binary numpy h5py lxml pillow filelock + # fabio.test.test_import unconditionally imports every module, + # including fabio/qt/dialogs.py, which needs a real Qt binding + # (PySide6/PyQt); none publish a riscv64 wheel anywhere. Skip that + # one module - test_all.suite() picks up test_import by name, so + # stubbing its suite() before building the suite drops just it. + CIBW_TEST_COMMAND: >- + python3 -c "import sys, unittest; from fabio.test import test_all, test_import; test_import.suite = lambda: unittest.TestSuite(); r = unittest.TextTestRunner().run(test_all.suite()); sys.exit(0 if r.wasSuccessful() else 1)" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: From 4653b765b4a92c317e6d22f787564c0b3b559615 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 7 Sep 2026 16:10:30 +0200 Subject: [PATCH 3/3] fabio: drop cp311 (no riscv64 h5py wheel for it), pin test deps to binary wheels --- .github/workflows/build-fabio.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-fabio.yml b/.github/workflows/build-fabio.yml index ad61676fc..aaf43c566 100644 --- a/.github/workflows/build-fabio.yml +++ b/.github/workflows/build-fabio.yml @@ -79,8 +79,10 @@ jobs: strategy: fail-fast: false matrix: - # Matches upstream's own release.yml CIBW_BUILD (cp311-cp314; no cp314t). - python: ["cp311", "cp312", "cp313", "cp314"] + # Upstream's own release.yml CIBW_BUILD is cp311-cp314 (no cp314t); cp311 + # is dropped here because pypi.riseproject.dev ships h5py - a hard + # runtime dep - only for cp312+ (gotcha 84). + python: ["cp312", "cp313", "cp314"] steps: - name: Download sdist @@ -103,7 +105,7 @@ jobs: # what the test suite actually exercises instead (gotcha 122). CIBW_TEST_ENVIRONMENT: PIP_NO_DEPS=1 CIBW_BEFORE_TEST_LINUX: >- - PIP_NO_DEPS=0 pip install --prefer-binary numpy h5py lxml pillow filelock + PIP_NO_DEPS=0 PIP_ONLY_BINARY=numpy,h5py,lxml,pillow pip install numpy h5py lxml pillow filelock # fabio.test.test_import unconditionally imports every module, # including fabio/qt/dialogs.py, which needs a real Qt binding # (PySide6/PyQt); none publish a riscv64 wheel anywhere. Skip that