Skip to content

biopython: add build-biopython.yml for riscv64 wheels - #539

Merged
luhenry merged 1 commit into
mainfrom
biopython
Aug 27, 2026
Merged

biopython: add build-biopython.yml for riscv64 wheels#539
luhenry merged 1 commit into
mainfrom
biopython

Conversation

@luhenry

@luhenry luhenry commented Aug 27, 2026

Copy link
Copy Markdown
Member

Adds .github/workflows/build-biopython.yml, building riscv64 wheels for biopython 1.88.

Shape

Build-from-checkout with cibuildwheel, per-interpreter matrix cp312/cp313/cp314/cp314t. biopython publishes real per-interpreter cpXY-cpXY manylinux wheels (no abi3 tag anywhere in its PyPI file list), and its 13 C extension modules are declared as [[tool.setuptools.ext-modules]] in pyproject.toml with no build-time dependency beyond setuptools>=74.1 — so the build is a plain pip wheel with no before-build, no Cython, and no native deps. numpy is a runtime dependency only.

Upstream's own ci.yml has no cibuildwheel config (its build_wheels job is just python -m build --wheel per interpreter on each OS), so the workflow follows this repo's standard cibuildwheel shape and mirrors upstream's steps rather than copying a wheels.yml that does not exist.

Version vs tag

Upstream tags releases as biopython-188 for version 1.88, so the version: input stays the plain PyPI version — which is what check_versions.py compares against — and the checkout ref is derived from it in a one-line step.

Testing

Mirrors upstream's test_macos/test_windows jobs: install only numpy (plus setuptools, which run_tests.py imports for find_packages) and run cd Tests && python run_tests.py --offline. PIP_EXTRA_INDEX_URL points at our registry so numpy resolves to the riscv64 wheel we ship (2.5.2, matching PyPI's latest).

CIBW_TEST_SOURCES: Tests Bio BioSQL Doc is load-bearing and was settled by dry-running the test phase against upstream's released PyPI wheel on this host before touching CI. run_tests.py enumerates its doctest modules by walking Tests/.. with setuptools.find_packages, and several tests open data through ../Bio/Align/substitution_matrices/data/BLOSUM62, ../Doc/examples/nmr/noed.xpk and ../Doc/Tutorial/index.rst. Measured: staging Tests alone collects 209 tests and fails test_align_substitution_matrices; adding Bio BioSQL collects 501 and fails the Bio.NMR.xpktools doctest; adding Doc passes all 501, with test_Tutorial running instead of skipping.

The staged source tree cannot shadow the wheel because every command runs from Tests/, which is what lands on sys.path[0] — verified by printing Bio.__file__ from there (it resolves into site-packages). This is exactly upstream's own layout, where Bio/ sits at Tests/.. as unbuilt source while the tests import the installed build.

Two independent proofs the wheel really is compiled: the test command imports all 13 extension modules by name before running the suite, and a post-build step asserts the wheel contains exactly 13 .so files.

Licensing

The wheel ships LICENSE.rst in dist-info/licenses/ (declared via license-files in pyproject.toml), which carries both the Biopython License Agreement and the BSD 3-Clause text that the individual C file headers refer to. No external C library is vendored — every .c source is Biopython's own tree.

Local validation

YAML parses; actionlint clean apart from the expected label "ubuntu-24.04-riscv" is unknown. python -m build --wheel from the biopython-188 checkout produces a wheel with all 13 extensions on this host.

Build biopython 1.88 riscv64 wheels with cibuildwheel, mirroring the
`build_wheels` job of upstream's ci.yml (a plain setuptools build of 13 C
extension modules, no build-time dependencies beyond setuptools) and its
`test_macos`/`test_windows` jobs, which install only numpy and run
`cd Tests && python run_tests.py --offline`.

Upstream tags releases as `biopython-188` for version 1.88, so the tag is
derived from the version input rather than taken directly.

run_tests.py enumerates the doctest modules by walking `Tests/..` and several
tests reach for `../Bio/Align/substitution_matrices/data` and `../Doc`, so
`test-sources` stages `Tests Bio BioSQL Doc` to reproduce upstream's checkout
layout around Tests/. Verified against the released PyPI wheel: staging `Tests`
alone collects 209 tests and fails one, and without `Doc` test_Tutorial skips;
the full staging collects 501 and passes. Every command runs from Tests/, which
is what lands on sys.path[0], so the staged source tree never shadows the wheel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@luhenry
luhenry merged commit 356a410 into main Aug 27, 2026
9 checks passed
@luhenry
luhenry deleted the biopython branch August 27, 2026 09:21
@luhenry luhenry linked an issue Aug 27, 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.

biopython riscv64 support

1 participant