Skip to content

pymongo: add build-pymongo.yml for riscv64 wheels - #340

Merged
luhenry merged 2 commits into
mainfrom
pymongo
Aug 25, 2026
Merged

pymongo: add build-pymongo.yml for riscv64 wheels#340
luhenry merged 2 commits into
mainfrom
pymongo

Conversation

@luhenry

@luhenry luhenry commented Aug 25, 2026

Copy link
Copy Markdown
Member

Adds .github/workflows/build-pymongo.yml, building riscv64 wheels for
pymongo 4.17.0 and publishing them to
pypi.riseproject.dev.

pymongo ships per-interpreter compiled wheels (bson._cbson,
pymongo._cmessage) for every architecture on PyPI except riscv64, so the
matrix is cp312/cp313/cp314/cp314t (not abi3).

Shape: build-from-checkout of the upstream 4.17.0 tag, pypa/cibuildwheel
with only: <tag>-manylinux_riscv64, inheriting upstream's
[tool.cibuildwheel] (build-frontend = "build", skip = "pp* *-musllinux*")
from pyproject.toml — same as upstream's own dist.yml.

Two riscv-relevant details:

  • PYMONGO_C_EXT_MUST_BUILD=1_setup.py's custom_build_ext swallows
    compile failures and ships a pure-Python wheel that still carries the
    manylinux_riscv64 tag (CLAUDE.md gotcha 20). This makes a failure fatal.
  • test-sources stages test/, tools/ and pyproject.toml into
    cibuildwheel's empty test cwd. Run from the checkout instead, pytest would
    put the repo root on sys.path and import the pure-Python bson/ source
    rather than the installed wheel — verified locally, bson.has_c() was
    False that way.

Testing mirrors upstream's wheel test (tools/fail_if_no_c.py) and adds the
subset of the suite that exercises the C extension without a running mongod —
including the BSON spec corpus. Locally (x86-independent check on macOS/arm64):
266 passed, 45 skipped, 33 subtests passed, with bson.has_c() true.

luhenry and others added 2 commits August 25, 2026 11:21
pymongo ships per-interpreter compiled wheels (bson._cbson,
pymongo._cmessage) for every arch but riscv64. Build-from-checkout with
cibuildwheel, inheriting upstream's [tool.cibuildwheel] config.

PYMONGO_C_EXT_MUST_BUILD=1 keeps _setup.py's optional-extension fallback
from silently shipping a pure-Python wheel. Tests run upstream's
fail_if_no_c.py plus the server-free subset of the suite that exercises
the C extension, staged via test-sources so the installed wheel is
imported instead of the checkout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@luhenry
luhenry merged commit 17bedf6 into main Aug 25, 2026
8 checks passed
@luhenry
luhenry deleted the pymongo branch August 25, 2026 09:52
@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.

pymongo riscv64 support

1 participant