From f305b92c2bbb79c78bba3850ac60e9ab57738e16 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 11 Sep 2026 19:08:42 +0200 Subject: [PATCH 1/2] biom-format: add build-biom-format.yml for riscv64 wheels --- .github/workflows/build-biom-format.yml | 89 +++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/build-biom-format.yml diff --git a/.github/workflows/build-biom-format.yml b/.github/workflows/build-biom-format.yml new file mode 100644 index 00000000000..57f3df0a41a --- /dev/null +++ b/.github/workflows/build-biom-format.yml @@ -0,0 +1,89 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/biocore/biom-format/blob/2.1.17/.github/workflows/wheels.yml +name: Build biom-format wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'biom-format version to build (git tag, e.g. 2.1.17)' + required: true + default: '2.1.17' + pull_request: + paths: + - '.github/workflows/build-biom-format.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '2.1.17' }}-${{ 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 2.1.17 there. + BIOM_FORMAT_VERSION: ${{ inputs.version || '2.1.17' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + setup: + uses: $/.github/workflows/_setup.yml + + build_wheels: + needs: [setup] + name: Build biom-format ${{ inputs.version || '2.1.17' }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + python: ["cp312", "cp313", "cp314", "cp314t"] + include: + # pandas (a hard runtime requirement) publishes no cp314t wheel on + # any platform or index, so the wheel itself builds fine but can't + # be installed for testing under cp314t; skip only the test phase. + - python: "cp314t" + test_skip: "*" + + steps: + - name: Checkout biom-format ${{ env.BIOM_FORMAT_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: biocore/biom-format + ref: ${{ env.BIOM_FORMAT_VERSION }} + persist-credentials: false + + - 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 }} + # numpy/scipy/pandas/h5py are build/runtime deps we ship on the + # registry; pin resolution to our wheels so pip doesn't instead pick + # PyPI's newer sdist-only releases (gotcha 84). cython has no + # riscv64 wheel on the registry but compiles from sdist in seconds, + # so it's left free to build. + CIBW_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy,scipy,pandas,h5py + CIBW_TEST_SKIP: ${{ matrix.test_skip }} + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: biom-format-${{ env.BIOM_FORMAT_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish biom-format ${{ inputs.version || '2.1.17' }} + needs: [setup, build_wheels] + permissions: + contents: write + pull-requests: write + uses: $/.github/workflows/_publish-wheel.yml + with: + artifact-pattern: biom-format-${{ inputs.version || '2.1.17' }}-*-manylinux_riscv64 From fe5123e1c3ee9139e14bbccb009196953165a9ea Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 11 Sep 2026 19:31:47 +0200 Subject: [PATCH 2/2] biom-format: patch table.py to use np.isin, numpy removed np.in1d np.in1d was deprecated since numpy 1.25 and removed entirely by the numpy our registry ships; np.isin is its documented drop-in replacement. Real compatibility fix, not riscv64-specific -- any user installing this wheel against a current numpy hits the same AttributeError. --- .github/workflows/build-biom-format.yml | 9 ++++++ ...le-use-np.isin-numpy-removed-np.in1d.patch | 31 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 patches/biom-format/2.1.17/0001-table-use-np.isin-numpy-removed-np.in1d.patch diff --git a/.github/workflows/build-biom-format.yml b/.github/workflows/build-biom-format.yml index 57f3df0a41a..9b65254c91f 100644 --- a/.github/workflows/build-biom-format.yml +++ b/.github/workflows/build-biom-format.yml @@ -55,6 +55,15 @@ jobs: ref: ${{ env.BIOM_FORMAT_VERSION }} persist-credentials: false + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + persist-credentials: false + + - name: Apply patches + run: git apply -v python-wheels/patches/biom-format/${{ env.BIOM_FORMAT_VERSION }}/*.patch + - name: Build wheels uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 with: diff --git a/patches/biom-format/2.1.17/0001-table-use-np.isin-numpy-removed-np.in1d.patch b/patches/biom-format/2.1.17/0001-table-use-np.isin-numpy-removed-np.in1d.patch new file mode 100644 index 00000000000..8d7d950171a --- /dev/null +++ b/patches/biom-format/2.1.17/0001-table-use-np.isin-numpy-removed-np.in1d.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Fri, 11 Sep 2026 17:30:00 +0200 +Subject: [PATCH] table: use np.isin, numpy removed np.in1d + +np.in1d was deprecated since numpy 1.25 and removed entirely by the numpy +our registry ships; np.isin is its documented drop-in replacement (identical +signature/semantics for this 1-D membership-test usage), so this is a real +compatibility fix, not riscv64-specific -- any user installing this wheel +against a current numpy hits the same AttributeError. + +Upstream-Status: To upstream [not yet submitted; needs a biom-format maintainer decision on the minimum supported numpy version] +--- + biom/table.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/biom/table.py b/biom/table.py +index 0000000..0000000 100644 +--- a/biom/table.py ++++ b/biom/table.py +@@ -4234,7 +4234,7 @@ class Table(object): + else: + desired_ids = np.asarray(desired_ids) + # Get the index of the source ids to include +- idx = np.in1d(source_ids, desired_ids) ++ idx = np.isin(source_ids, desired_ids) + # Retrieve only the ids that we are interested on + ids = source_ids[idx] + # Check that all desired ids have been found on source ids +-- +2.43.0