Skip to content

Build wheels with cibuildwheel; publish to PyPI by trusted publishing - #45

Merged
benfulcher merged 1 commit into
mainfrom
ci/wheels
Oct 20, 2026
Merged

benfulcher merged 1 commit into
mainfrom
ci/wheels

Conversation

@benfulcher

@benfulcher benfulcher commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

pycatch22 has only ever shipped an sdist, so installing it compiles the C, which needs a C compiler. On Windows that means Visual Studio's build tools, and without them pip install pycatch22 fails. This adds pre-built wheels.

Wheels workflow (.github/workflows/wheels.yml, config in pyproject.toml):

  • Builds: cibuildwheel v4.3.1 builds wheels for CPython 3.9 to 3.15 on Linux (x86_64 and aarch64, both on native runners; manylinux and musllinux), macOS (Intel and Apple Silicon, from one Apple Silicon runner) and Windows.
  • Tests: each wheel is tested with the unit tests and the full comparison against catch22's expected outputs.
  • Not covered: Python 3.8 installs from the sdist as now (cibuildwheel 4 dropped 3.8). Free-threaded builds (3.14t) are skipped until the C extension declares that it doesn't need the GIL.
  • When it runs: on PRs and pushes to main, it builds and tests only.

Publishing (trusted publishing): on a published GitHub release, the workflow uploads the wheels and sdist to PyPI with pypa/gh-action-pypi-publish, with no API token. This needs a one-time setup on PyPI: pycatch22 → Manage → Publishing → add a GitHub publisher with owner DynamicsAndNeuralSystems, repository pycatch22, workflow wheels.yml and environment pypi. It can also be run by hand (Actions → Wheels → Run workflow, with publish ticked) to add wheels to an existing release such as 1.0.1. Files already on PyPI, like the 1.0.1 sdist, are skipped.

CI result (first run, all green): 56 wheels (6.2 MB in total): CPython 3.9 to 3.15 × manylinux and musllinux on x86_64 and aarch64, macOS x86_64 and arm64, and Windows 64- and 32-bit. Every wheel passed all 1036 tests, including the macOS Intel wheels, which run under Rosetta on the Apple Silicon runner.

🤖 Generated with Claude Code

pycatch22 shipped only an sdist, so installing it needed a C compiler (on
Windows, Visual Studio's build tools). The Wheels workflow builds wheels with
cibuildwheel v4.3.1 for CPython 3.9-3.15 on Linux (x86_64 and aarch64,
manylinux and musllinux), macOS (Intel and Apple Silicon) and Windows, and
tests each against catch22's expected outputs. Python 3.8 (unsupported by
cibuildwheel 4) installs from the sdist; free-threaded builds are skipped for
now.

On a published GitHub release it uploads the wheels and sdist to PyPI by
trusted publishing (needs the publisher set up on PyPI, environment "pypi");
it can also be run by hand with publish ticked to add wheels to an existing
release, skipping files already on PyPI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@benfulcher
benfulcher marked this pull request as ready for review October 20, 2026 02:07
@benfulcher
benfulcher merged commit 9b4c0e7 into main Oct 20, 2026
25 checks passed
@benfulcher
benfulcher deleted the ci/wheels branch October 20, 2026 02:22
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.

1 participant