From 86f6ddbd7a248884eee67cf095315680c744bcd1 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Thu, 15 Oct 2026 23:03:15 +0000 Subject: [PATCH] Add pycifrw riscv64 wheel build PyCifRW (CifFile) is a CIF/STAR crystallography file parser with a small compiled C extension (CifFile.StarScan, built from src/lib/lex.yy.c and src/lib/py_star_scan.c). No riscv64 wheel on PyPI. Build-from-checkout cibuildwheel job at tag v5.0.1, matching upstream's plain setuptools Extension build; runtime deps (prettytable, ply, numpy) all resolve on riscv64 via pypi.riseproject.dev. --- .github/workflows/build-pycifrw.yml | 98 +++++++++++++++++++++++++++++ docs/packages/pycifrw.yaml | 5 ++ 2 files changed, 103 insertions(+) create mode 100644 .github/workflows/build-pycifrw.yml create mode 100644 docs/packages/pycifrw.yaml diff --git a/.github/workflows/build-pycifrw.yml b/.github/workflows/build-pycifrw.yml new file mode 100644 index 000000000000..cc4d5046aafd --- /dev/null +++ b/.github/workflows/build-pycifrw.yml @@ -0,0 +1,98 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +name: Build pycifrw wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/pycifrw.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-pycifrw.yml' + - 'docs/packages/pycifrw.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-pycifrw.yml' + - 'docs/packages/pycifrw.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: pycifrw + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build pycifrw ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + # Per-interpreter: the StarScan C extension links the version-specific ABI. + python: ["cp312", "cp313", "cp314", "cp314t"] + + env: + PYCIFRW_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout PyCIFRW v${{ env.PYCIFRW_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: jamesrhester/pycifrw + ref: v${{ env.PYCIFRW_VERSION }} + persist-credentials: false + + - name: Build and test wheel + 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 }} + CIBW_ENVIRONMENT: >- + PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + PIP_ONLY_BINARY=numpy + CIBW_TEST_COMMAND: python {project}/TestPyCIFRW.py + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pycifrw-${{ env.PYCIFRW_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish pycifrw ${{ 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: pycifrw-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/pycifrw.yaml b/docs/packages/pycifrw.yaml new file mode 100644 index 000000000000..325bf61f2ddc --- /dev/null +++ b/docs/packages/pycifrw.yaml @@ -0,0 +1,5 @@ +package-name: pycifrw +source-code: https://github.com/jamesrhester/pycifrw +license: PSF-2.0 +versions: +- version: 5.0.1