Skip to content

ci: build Python wheels and publish them to PyPI on release - #33

Merged
jcwal1516 merged 1 commit into
mainfrom
feat/python-wheels
Oct 29, 2026
Merged

jcwal1516 merged 1 commit into
mainfrom
feat/python-wheels

Conversation

@jcwal1516

Copy link
Copy Markdown
Member

Adds .github/workflows/python-wheels.yml so a release ships the Python bindings to PyPI as wsi-rs, and pip install wsi-rs works.

What it does

  • Builds abi3 wheels for Python 3.10 and later, and an sdist, from the committed Cargo.lock. The wheels cover:
    • Linux x86_64 and aarch64 (manylinux_2_28);
    • macOS arm64 and x86_64;
    • Windows x64.
  • Tests every wheel by installing it on Python 3.10 (the abi3 floor) and running wsi-rs-python/tests.
  • On a published GitHub release:
    • checks that the tag matches the wsi-rs-python version;
    • attaches the wheels and sdist to the release, with build-provenance attestations;
    • publishes them to PyPI through trusted publishing in a pypi environment. No token is stored.
  • On pull requests that touch wsi-rs-python/** or this workflow, and on manual runs: builds and tests only. This PR runs it.

Actions are pinned by commit SHA, using releases at least two weeks old:

  • PyO3/maturin-action v1.51.0;
  • pypa/gh-action-pypi-publish v1.14.2;
  • actions/download-artifact v7.0.0, to match upload-artifact v7.

The only event input used in a shell step is the release tag, passed through env.

The Python README, which becomes the PyPI project page, now leads with pip install wsi-rs. pyproject.toml gains keywords, classifiers, and Issues and Changelog URLs.

Setup needed before the first release

  1. On pypi.org, add a pending trusted publisher for project wsi-rs. The name is currently free:
    • owner frames-sg
    • repository wsi-rs
    • workflow python-wheels.yml
    • environment pypi
  2. In this repo's settings, create the pypi environment. Optionally add yourself as a required reviewer, so each PyPI publish waits for approval.

Verification

  • actionlint passes on the workflow.
  • Locally, the sdist (1.6 MB, sources only) builds a working abi3 wheel on its own.
  • The repo-integrity tests pass.
  • This PR's python-wheels run builds and tests all five wheels and the sdist.

A published GitHub release now builds abi3 wheels for Python 3.10 and
later (Linux x86_64 and aarch64 on manylinux_2_28, macOS arm64 and x86_64,
Windows x64) and an sdist from the committed Cargo.lock. Each wheel is
installed and runs the Python tests on the oldest supported Python, then
everything is attached to the release with build provenance and published
to PyPI as wsi-rs through trusted publishing in the `pypi` environment.
The release tag must match the wsi-rs-python version.

Pull requests that touch the bindings or this workflow build and test the
same wheels without publishing. The Python README, now the PyPI page,
leads with `pip install wsi-rs`, and pyproject gains classifiers and
project URLs.
@jcwal1516
jcwal1516 merged commit 4d237da into main Oct 29, 2026
28 checks passed
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