diff --git a/.github/workflows/build-openbabel-wheel.yml b/.github/workflows/build-openbabel-wheel.yml new file mode 100644 index 000000000000..46bb8f58f62d --- /dev/null +++ b/.github/workflows/build-openbabel-wheel.yml @@ -0,0 +1,119 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# pyproject.toml's own [tool.cibuildwheel] table (build-command, cmake defines, the +# cp312-cp314t matrix, the forcefield/obabel test-command) is used as-is apart from the +# patch below; only the riscv64 image and the Linux native deps (replacing the +# manylinux2014 before-all at +# https://github.com/njzjz/openbabel-wheel/blob/v3.1.1.23/pyproject.toml) are overridden +# here. +name: Build openbabel-wheel wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/openbabel-wheel.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-openbabel-wheel.yml' + - 'docs/packages/openbabel-wheel.yaml' + - 'patches/openbabel-wheel/**' + push: + branches: [main] + paths: + - '.github/workflows/build-openbabel-wheel.yml' + - 'docs/packages/openbabel-wheel.yaml' + - 'patches/openbabel-wheel/**' + +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: openbabel-wheel + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build openbabel-wheel ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + python: + - "cp312" + - "cp313" + - "cp314" + - "cp314t" + + env: + OPENBABEL_WHEEL_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout openbabel-wheel ${{ env.OPENBABEL_WHEEL_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: njzjz/openbabel-wheel + ref: v${{ env.OPENBABEL_WHEEL_VERSION }} + persist-credentials: false + + - name: Checkout python-wheels + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + path: python-wheels + persist-credentials: false + + - name: Patch openbabel-wheel source + run: git apply python-wheels/patches/openbabel-wheel/${{ env.OPENBABEL_WHEEL_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 }} + # manylinux2014's cairo-devel is too old for OpenBabel's depiction code, + # which is why upstream builds cairo 1.15.14 from source instead; Rocky 10 + # (this image) ships a current one, so installing it directly is simpler + # and the other libraries it names (freetype/libpng/pixman) come in as its + # dependencies. + CIBW_BEFORE_ALL_LINUX: dnf install -y libxml2-devel zlib-devel cairo-devel + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: openbabel-wheel-${{ env.OPENBABEL_WHEEL_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish openbabel-wheel ${{ 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: openbabel-wheel-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/openbabel-wheel.yaml b/docs/packages/openbabel-wheel.yaml new file mode 100644 index 000000000000..94576fb595e3 --- /dev/null +++ b/docs/packages/openbabel-wheel.yaml @@ -0,0 +1,6 @@ +package-name: openbabel-wheel +source-code: https://github.com/njzjz/openbabel-wheel +license: GPL-2.0-only +versions: +- version: 3.1.1.23 + patched: true diff --git a/patches/openbabel-wheel/3.1.1.23/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch b/patches/openbabel-wheel/3.1.1.23/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch new file mode 100644 index 000000000000..58ad72fc1983 --- /dev/null +++ b/patches/openbabel-wheel/3.1.1.23/0001-pyproject-drop-the-removed-cpython-freethreading-enable-group.patch @@ -0,0 +1,36 @@ +From 178b5b8ed98042762e011b9f321fd19a50d43a86 Mon Sep 17 00:00:00 2001 +From: Ludovic Henry +Date: Fri, 16 Oct 2026 01:05:08 +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 [tool.cibuildwheel] is parsed as a whole. +The enable value was deprecated in cibuildwheel 3.4.1 and removed +outright in 4.0.0 (CPython 3.14+ free-threaded wheels build without +any enable flag now); upstream's own release workflow still pins +cibuildwheel v3.3, where the option remains valid, so the tag is not +broken for them yet. + +Upstream-Status: To upstream [not yet submitted] +--- + pyproject.toml | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index f624e43..4ea0758 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -76,7 +76,6 @@ test-command = [ + ] + build = ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "cp313-*", "cp313t-*", "cp314-*", "cp314t-*"] + skip = ["*-win32", "*-manylinux_i686", "*-musllinux*", "cp314t-win_amd64"] +-enable = ["cpython-freethreading"] + manylinux-x86_64-image = "manylinux2014" + manylinux-aarch64-image = "manylinux2014" + +-- +2.43.0 +