From ee068d258de7f671510498ee66d200efebb80fb1 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 15 Oct 2026 20:10:23 +0000 Subject: [PATCH 1/2] affinegap: add riscv64 wheel build Cython implementation of the affine gap string distance, used by dedupe/usaddress-style record-linkage and census-deduplication tooling. PyPI ships wheels for many platforms but none past cp310 and none for riscv64 on any Python version; upstream carries no CI wheel-building workflow left to mirror, so this is a plain cibuildwheel build against the v1.12 tag with no system dependencies. --- .github/workflows/build-affinegap.yml | 97 +++++++++++++++++++++++++++ docs/packages/affinegap.yaml | 5 ++ 2 files changed, 102 insertions(+) create mode 100644 .github/workflows/build-affinegap.yml create mode 100644 docs/packages/affinegap.yaml diff --git a/.github/workflows/build-affinegap.yml b/.github/workflows/build-affinegap.yml new file mode 100644 index 000000000000..f277af9a8a17 --- /dev/null +++ b/.github/workflows/build-affinegap.yml @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# affinegap carries no upstream CI wheel-building workflow (its old Travis +# config was removed; pyproject.toml only declares the setuptools/cython +# build-system), so this plain cibuildwheel build has nothing to narrow. +name: Build affinegap wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/affinegap.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-affinegap.yml' + - 'docs/packages/affinegap.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-affinegap.yml' + - 'docs/packages/affinegap.yaml' + +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: affinegap + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build affinegap ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: ["cp312", "cp313", "cp314", "cp314t"] + + env: + AFFINEGAP_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout affinegap v${{ env.AFFINEGAP_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: datamade/affinegap + ref: v${{ env.AFFINEGAP_VERSION }} + persist-credentials: false + + - uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + env: + CIBW_ARCHS: riscv64 + CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_TEST_COMMAND: >- + python -c "import affinegap.affinegap as m; assert m.__file__.endswith('.so'), m.__file__" && + python -m unittest discover -t "{project}" "{project}/tests" + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: affinegap-${{ env.AFFINEGAP_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: ./wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish affinegap ${{ 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: affinegap-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/affinegap.yaml b/docs/packages/affinegap.yaml new file mode 100644 index 000000000000..961d657ce474 --- /dev/null +++ b/docs/packages/affinegap.yaml @@ -0,0 +1,5 @@ +package-name: affinegap +source-code: https://github.com/datamade/affinegap +license: MIT +versions: +- version: 1.12 From 8a27b828d0dbfd614c583f8ce4f9bebc6c728e5a Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Sun, 25 Oct 2026 18:05:28 +0000 Subject: [PATCH 2/2] affinegap: fix unittest discover against tests/ with no __init__.py affinegap's tests/ ships with test_affinegap.py but no __init__.py, so unittest discover with a separate top-level dir (-t "{project}" "{project}/tests") fails on every leg: ImportError: Start directory is not importable. Letting -t default to the start dir (-s "{project}/tests") skips that importability check. --- .github/workflows/build-affinegap.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-affinegap.yml b/.github/workflows/build-affinegap.yml index f277af9a8a17..6b294874e66b 100644 --- a/.github/workflows/build-affinegap.yml +++ b/.github/workflows/build-affinegap.yml @@ -69,9 +69,14 @@ jobs: CIBW_ARCHS: riscv64 CIBW_BUILD: ${{ matrix.python }}-manylinux_riscv64 CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + # affinegap's tests/ ships with no tests/__init__.py (upstream never added + # one), so `unittest discover` with a separate top-level dir (-t "{project}") + # fails importing the start dir: "ImportError: Start directory is not + # importable: '.../tests'" (reproduces on any host, no riscv64/QEMU needed). + # Letting -t default to the start dir itself avoids that import check. CIBW_TEST_COMMAND: >- python -c "import affinegap.affinegap as m; assert m.__file__.endswith('.so'), m.__file__" && - python -m unittest discover -t "{project}" "{project}/tests" + python -m unittest discover -s "{project}/tests" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: