From 9790605870901b87df8d5605867bcdd231643ed8 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Wed, 14 Oct 2026 10:06:40 +0000 Subject: [PATCH] xa11y: Add version 0.15.2 PyO3/maturin extension (pyo3 abi3-py39) wrapping the xa11y Rust accessibility client; on Linux it links libxkbcommon, which auditwheel vendors. Built on cp312 and re-tested on cp313/cp314; upstream ships no free-threaded wheel. The v0.15.2 tag carries xa11y-python/Cargo.toml at 0.15.1: upstream's publish job stamps the workspace version into it after cargo-release tags, so the workflow repeats that step. Upstream wheels carry no licence file because the LICENSE sits at the repo root, not beside pyproject.toml; the workflow stages it and libxkbcommon's licence there. --- .github/workflows/build-xa11y.yml | 118 ++++++++++++++++++++++++++++++ docs/packages/xa11y.yaml | 5 ++ 2 files changed, 123 insertions(+) create mode 100644 .github/workflows/build-xa11y.yml create mode 100644 docs/packages/xa11y.yaml diff --git a/.github/workflows/build-xa11y.yml b/.github/workflows/build-xa11y.yml new file mode 100644 index 000000000000..9b01926815f7 --- /dev/null +++ b/.github/workflows/build-xa11y.yml @@ -0,0 +1,118 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# Based on the `version-bump`/`build-wheels-linux` jobs of +# https://github.com/xa11y/xa11y/blob/v0.15.2/.github/workflows/publish.yml +# and the `python` job of https://github.com/xa11y/xa11y/blob/v0.15.2/.github/workflows/ci.yml +name: Build xa11y wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'Version glob to (re)build; empty builds every version of docs/packages/xa11y.yaml not released yet' + required: false + default: '' + pull_request: + branches: [main] + paths: + - '.github/workflows/build-xa11y.yml' + - 'docs/packages/xa11y.yaml' + push: + branches: [main] + paths: + - '.github/workflows/build-xa11y.yml' + - 'docs/packages/xa11y.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: xa11y + version: ${{ inputs.version }} + + build_wheels: + needs: [setup] + if: needs.setup.outputs.versions != '[]' + name: Build xa11y ${{ matrix.version }} cp39-abi3-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.setup.outputs.versions) }} + + env: + XA11Y_VERSION: ${{ matrix.version }} + + steps: + - name: Checkout xa11y v${{ env.XA11Y_VERSION }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: xa11y/xa11y + ref: v${{ env.XA11Y_VERSION }} + persist-credentials: false + + # Upstream's release job stamps the workspace version into xa11y-python after tagging. + - name: Sync Python package version + run: | + VERSION=$(sed -n '/\[workspace\.package\]/,/\[/{s/^version = "\(.*\)"/\1/p}' Cargo.toml) + test "$VERSION" = "$XA11Y_VERSION" + sed -i "s/^version = \".*\"/version = \"$VERSION\"/" xa11y-python/Cargo.toml + + - name: Stage the licence beside xa11y-python's pyproject.toml + run: cp LICENSE xa11y-python/ + + - name: Build wheels + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 + with: + package-dir: xa11y-python + output-dir: wheelhouse/ + env: + CIBW_BUILD: cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64 + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} + CIBW_BEFORE_ALL_LINUX: >- + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && + dnf install -y dbus-devel libxkbcommon-devel && + cp /usr/share/licenses/libxkbcommon/LICENSE {project}/xa11y-python/LICENSE.libxkbcommon + CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" + CIBW_TEST_REQUIRES: pytest + CIBW_TEST_SOURCES: xa11y-python/tests + CIBW_TEST_COMMAND: >- + python -c "import importlib.metadata as md; + lic = {p.name for p in md.files('xa11y') if '.dist-info/licenses/' in str(p)} - {''}; + assert lic == {'LICENSE', 'LICENSE.libxkbcommon'}, lic" && + python -m pytest -v xa11y-python/tests + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: xa11y-${{ env.XA11Y_VERSION }}-cp39-abi3-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish xa11y ${{ 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: xa11y-${{ matrix.version }}-*-manylinux_riscv64 diff --git a/docs/packages/xa11y.yaml b/docs/packages/xa11y.yaml new file mode 100644 index 000000000000..df560bb994db --- /dev/null +++ b/docs/packages/xa11y.yaml @@ -0,0 +1,5 @@ +package-name: xa11y +source-code: https://github.com/xa11y/xa11y +license: MIT +versions: +- version: 0.15.2