Skip to content

asyncpg: add build-asyncpg.yml for riscv64 wheels - #342

Merged
luhenry merged 4 commits into
mainfrom
asyncpg
Aug 25, 2026
Merged

asyncpg: add build-asyncpg.yml for riscv64 wheels#342
luhenry merged 4 commits into
mainfrom
asyncpg

Conversation

@luhenry

@luhenry luhenry commented Aug 25, 2026

Copy link
Copy Markdown
Member

Adds .github/workflows/build-asyncpg.yml, building riscv64 wheels for
asyncpg 0.31.0.

asyncpg is a Cython-based PostgreSQL driver. PyPI ships per-interpreter
compiled wheels (cpXY-cpXY, not abi3) for macOS/Windows/manylinux
x86_64+aarch64 and musllinux, but nothing for riscv64.

Shape

Build-from-checkout, mirroring upstream's release.yml:
check out the v0.31.0 tag with submodules (asyncpg/pgproto) and run
pypa/cibuildwheel. Everything else — build-frontend, test-groups, the
Linux test-command — is inherited from upstream's [tool.cibuildwheel] in
pyproject.toml unchanged.

Testing is upstream's exact invocation: it initdb's a real PostgreSQL cluster
and runs the full tests/__init__.py unittest suite as a non-root apgtest
user, including the flake8/mypy source-quality tests and the Kerberos GSSAPI
auth tests via k5test. 314 tests on cp312/cp313 and 316 on cp314/cp314t
(the extra two are test_subinterpreters, which needs concurrent.interpreters
from 3.14), with 3 skips — all legitimate: Windows-only SSPI auth and two
test__environment assertions gated on ASYNCPG_VERSION/PGVERSION.

Each wheel carries three riscv64 extension modules: asyncpg/pgproto/pgproto,
asyncpg/protocol/protocol and asyncpg/protocol/record.

riscv64 deviations

Two, both in the cibuildwheel env::

  • CIBW_BEFORE_ALL_LINUX replaces upstream's install-postgres.sh +
    install-krb5.sh. Those scripts branch on /etc/os-release ID and only
    know debian/ubuntu/almalinux/centos/alpine; the
    manylinux_2_39_riscv64 image is Rocky Linux 10, so they hit the final
    else and exit 1. The replacement dnf installs the same package set and
    creates the same apgtest user.
  • CIBW_BEFORE_BUILD + CIBW_BUILD_FRONTEND pin setuptools<82 and disable
    build isolation. asyncpg's setup.py imports pkg_resources on the
    cythonise path, which setuptools 82.0.0 removed; pyproject.toml only
    floors setuptools (>=77.0.3), so an isolated build resolves to today's
    latest and fails with ModuleNotFoundError: No module named 'pkg_resources'.
    This is upstream toolchain drift, not arch-specific — it reproduces on x86
    and arm64.

CIBW_ENVIRONMENT points pip at pypi.riseproject.dev so that uvloop
in upstream's test dependency-group, and with no riscv64 wheel on public
PyPI — resolves from our registry. The group is otherwise inherited verbatim.

luhenry and others added 4 commits August 25, 2026 11:47
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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.
@luhenry
luhenry merged commit 264341d into main Aug 25, 2026
9 checks passed
@luhenry
luhenry deleted the asyncpg branch August 25, 2026 12:36
@luhenry luhenry linked an issue Aug 25, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asyncpg riscv64 support

1 participant