From c9b9894235f98fb57ec6776115ace660018f9043 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 25 Aug 2026 11:47:14 +0200 Subject: [PATCH 1/4] asyncpg: add build-asyncpg.yml for riscv64 wheels asyncpg is a Cython-based PostgreSQL driver; PyPI ships per-interpreter compiled wheels for every arch but riscv64. Build from the upstream tag with cibuildwheel, inheriting upstream's [tool.cibuildwheel] test-command (a real PostgreSQL cluster driven by the full unittest suite, run as a non-root user). The manylinux riscv64 image is Rocky 10, which upstream's install-postgres.sh / install-krb5.sh do not recognise, so before-all installs those packages directly. uvloop is dropped from the test dependency-group: it has no riscv64 wheel at the pinned floor and the suite only imports it when USE_UVLOOP is set. Co-Authored-By: Claude Opus 5 --- .github/workflows/build-asyncpg.yml | 98 +++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/build-asyncpg.yml diff --git a/.github/workflows/build-asyncpg.yml b/.github/workflows/build-asyncpg.yml new file mode 100644 index 00000000..70b9ff50 --- /dev/null +++ b/.github/workflows/build-asyncpg.yml @@ -0,0 +1,98 @@ +# SPDX-FileCopyrightText: 2026 The RISE Project +# SPDX-License-Identifier: MIT +--- +# This workflow is based on: https://github.com/MagicStack/asyncpg/blob/v0.31.0/.github/workflows/release.yml +name: Build asyncpg wheels (riscv64) + +on: + workflow_dispatch: + inputs: + version: + description: 'asyncpg version to build (PyPI version, e.g. 0.31.0)' + required: true + default: '0.31.0' + pull_request: + paths: + - '.github/workflows/build-asyncpg.yml' + +concurrency: + group: ${{ github.workflow }}-${{ inputs.version || '0.31.0' }}-${{ 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 0.31.0 there. + ASYNCPG_VERSION: ${{ inputs.version || '0.31.0' }} + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 + +jobs: + build_wheels: + name: Build asyncpg ${{ inputs.version || '0.31.0' }} ${{ matrix.python }}-manylinux_riscv64 + runs-on: ubuntu-24.04-riscv + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + # Per-interpreter (not abi3): PyPI ships a cpXY-cpXY wheel for each. + python: + - "cp312" + - "cp313" + - "cp314" + - "cp314t" + + steps: + - name: Checkout asyncpg v${{ env.ASYNCPG_VERSION }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: MagicStack/asyncpg + ref: v${{ env.ASYNCPG_VERSION }} + submodules: true # asyncpg/pgproto + 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 }} + CIBW_BUILD_VERBOSITY: '1' + # Upstream's before-all scripts only know debian/almalinux/centos/alpine and + # bail on the Rocky 10 riscv64 image; install the same packages directly. + CIBW_BEFORE_ALL_LINUX: >- + dnf install -y --setopt=install_weak_deps=False + postgresql-server postgresql-contrib libpq-devel + krb5-server krb5-workstation krb5-devel + && useradd -m -s /bin/bash apgtest + # Upstream's `test` dependency-group minus uvloop: no riscv64 wheel exists + # for >=0.22.1 and the suite only loads it when USE_UVLOOP is set. + CIBW_TEST_GROUPS: '' + CIBW_TEST_REQUIRES: >- + flake8~=6.1 flake8-pyi~=24.1.0 distro~=1.9.0 + gssapi k5test mypy~=1.8.0 pytest + + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: asyncpg-${{ env.ASYNCPG_VERSION }}-${{ matrix.python }}-manylinux_riscv64 + path: wheelhouse/*.whl + if-no-files-found: error + + publish: + name: Publish asyncpg ${{ inputs.version || '0.31.0' }} to GitLab + needs: [build_wheels] + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Publish wheels and open docs PR + uses: riseproject-dev/python-wheels/actions/publish-wheels@main + with: + artifact-pattern: asyncpg-${{ env.ASYNCPG_VERSION }}-*-manylinux_riscv64 + gitlab-username: ${{ vars.GITLAB_DEPLOY_USER }} + gitlab-token: ${{ secrets.GITLAB_DEPLOY_TOKEN }} + gitlab-project-id: ${{ vars.GITLAB_PROJECT_ID }} + gh-token: ${{ secrets.GITHUB_TOKEN }} From 93a0a09fedd2e89fe4bb09335b07d059fd8136b7 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 25 Aug 2026 11:51:08 +0200 Subject: [PATCH 2/4] asyncpg: drop CIBW_BUILD_VERBOSITY --- .github/workflows/build-asyncpg.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-asyncpg.yml b/.github/workflows/build-asyncpg.yml index 70b9ff50..64e73e5a 100644 --- a/.github/workflows/build-asyncpg.yml +++ b/.github/workflows/build-asyncpg.yml @@ -58,7 +58,6 @@ jobs: only: ${{ matrix.python }}-manylinux_riscv64 env: CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} - CIBW_BUILD_VERBOSITY: '1' # Upstream's before-all scripts only know debian/almalinux/centos/alpine and # bail on the Rocky 10 riscv64 image; install the same packages directly. CIBW_BEFORE_ALL_LINUX: >- From 517852d9da0a8a910f66212e1133755173965c32 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 25 Aug 2026 12:05:04 +0200 Subject: [PATCH 3/4] asyncpg: pin setuptools<82 for the wheel build setuptools 82 removed pkg_resources, which asyncpg's setup.py imports on the cythonise path; pyproject only floors setuptools>=77.0.3, so a fresh build resolves to the breaking version and dies in finalize_options. Co-Authored-By: Claude Opus 5 --- .github/workflows/build-asyncpg.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-asyncpg.yml b/.github/workflows/build-asyncpg.yml index 64e73e5a..956c436e 100644 --- a/.github/workflows/build-asyncpg.yml +++ b/.github/workflows/build-asyncpg.yml @@ -65,6 +65,10 @@ jobs: postgresql-server postgresql-contrib libpq-devel krb5-server krb5-workstation krb5-devel && useradd -m -s /bin/bash apgtest + # setuptools 82 dropped pkg_resources, which setup.py imports to cythonise; + # pyproject only floors setuptools, so pin it and drop build isolation. + CIBW_BEFORE_BUILD: pip install "setuptools<82" "Cython>=3.2.1,<4.0.0" wheel + CIBW_BUILD_FRONTEND: "build; args: --no-isolation" # Upstream's `test` dependency-group minus uvloop: no riscv64 wheel exists # for >=0.22.1 and the suite only loads it when USE_UVLOOP is set. CIBW_TEST_GROUPS: '' From 81bc1a7d44ebdf3303b4608f6be4a9478ac836f5 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Tue, 25 Aug 2026 12:40:07 +0200 Subject: [PATCH 4/4] asyncpg: inherit upstream's test group, resolve uvloop from our registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit uvloop 0.22.1 — the latest release on PyPI — has riscv64 wheels on pypi.riseproject.dev for cp312/cp313/cp314/cp314t, so there is no need to drop it from upstream's `test` dependency-group and hand-maintain a copy of the remaining requirements. Inherit `test-groups = "test"` unchanged and point pip at our registry instead. --- .github/workflows/build-asyncpg.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-asyncpg.yml b/.github/workflows/build-asyncpg.yml index 956c436e..8a4bb4c0 100644 --- a/.github/workflows/build-asyncpg.yml +++ b/.github/workflows/build-asyncpg.yml @@ -48,7 +48,7 @@ jobs: with: repository: MagicStack/asyncpg ref: v${{ env.ASYNCPG_VERSION }} - submodules: true # asyncpg/pgproto + submodules: true persist-credentials: false - name: Build wheels @@ -69,12 +69,8 @@ jobs: # pyproject only floors setuptools, so pin it and drop build isolation. CIBW_BEFORE_BUILD: pip install "setuptools<82" "Cython>=3.2.1,<4.0.0" wheel CIBW_BUILD_FRONTEND: "build; args: --no-isolation" - # Upstream's `test` dependency-group minus uvloop: no riscv64 wheel exists - # for >=0.22.1 and the suite only loads it when USE_UVLOOP is set. - CIBW_TEST_GROUPS: '' - CIBW_TEST_REQUIRES: >- - flake8~=6.1 flake8-pyi~=24.1.0 distro~=1.9.0 - gssapi k5test mypy~=1.8.0 pytest + # uvloop, in upstream's inherited `test` group, has no riscv64 wheel on PyPI. + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: