Skip to content

ci(release): publish crates and bloqade-ppvm in lockstep with release-plz - #237

Open
david-pl wants to merge 5 commits into
mainfrom
david/pypi-release
Open

david-pl wants to merge 5 commits into
mainfrom
david/pypi-release

Conversation

@david-pl

@david-pl david-pl commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Sets up automated releases of the Rust crates (crates.io) and the Python package (PyPI) under one shared version, modelled on vihaco's release-plz setup.

  • Python package renamed to bloqade-ppvm (ppvm is taken on PyPI); import ppvm is unchanged. Adds real metadata (description, Apache-2.0, URLs, classifiers) and ships LICENSE, NOTICE and AUTHORS in the wheel and sdist. The version now comes from Cargo.
  • One workspace version. [workspace.package] holds version/edition/license/repository and every crate inherits it, including ppvm-python-native, so the Python version follows automatically.
  • 12 crates get crates.io metadata: traits, pauli-word, pauli-sum, sym, tableau, tableau-sum, stim, stim-parser, vihaco-circuit-isa, ppvm-vihaco, ppvm-cli and ppvm-tui. Each gets a description, plus LICENSE/NOTICE symlinks so the packages carry them. The root ppvm examples package, ppvm-traits-2 and ppvm-python-native are publish = false.
  • .github/workflows/release-plz.yml: on each push to main, release-plz maintains a release PR. Once that PR is merged, it publishes the crates and creates one v0.x.y tag and GitHub release. If something was released, the same run builds abi3 wheels (linux x86_64/aarch64, macOS x86_64/arm64, windows x86_64) and an sdist, runs the Python test suite against each installed wheel, and publishes to PyPI. Both registries use trusted publishing (OIDC). Manual runs build and test only, with an opt-in publish_pypi switch for the first release and for recovery.
  • Fixes the linux-aarch64 build: gxhash needs AES, which aarch64 Linux doesn't enable by default; added to .cargo/config.toml.
  • Developer Guide § 8 Releasing documents the flow, breaking changes, recovery, adding a crate and the one-time 0.1.0 bootstrap.

Known limitation: release-plz only tracks published crates, so changes confined to ppvm-python/ or ppvm-python-native don't open a release PR. To release them, merge a PR that bumps [workspace.package].version (see § 8.2).

Before / after merge

  • A repo admin creates the pypi environment (the PyPI pending publisher already points at release-plz.yml + pypi).
  • Check the crate descriptions read well; three of them (ppvm-tableau-sum, vihaco-circuit-isa, ppvm-vihaco) are drafts.
  • Check with the vihaco maintainers that publishing vihaco-circuit-isa from this repo is OK.
  • After merge, bootstrap 0.1.0 by hand as in Developer Guide § 8.6. Until then, the release job fails on pushes to main.
  • First manual run of the workflow, to confirm all 5 wheels build in CI.

Test plan

  • cargo package --workspace: every crate builds from its packaged form (largest is 1.5 MiB).
  • Linux aarch64: cargo check --target aarch64-unknown-linux-gnu on the gxhash crates fails without the fix and passes with it.
  • uv build (sdist, then a wheel built from it): twine check passes, the metadata is correct, and the license files are included.
  • All 221 Python tests pass against the installed wheel in a clean env, and in the dev env.
  • release-plz update on a scratch copy reads the config: 12 crates in one group, ppvm-cli last, single root CHANGELOG.md.
  • actionlint, the pre-commit hooks and the docs build (npm run astro:build) pass.
  • The release-plz jobs themselves can only be tested after merge.

🤖 Generated with Claude Code

david-pl and others added 4 commits October 6, 2026 14:28
Add a release workflow that builds abi3 wheels for linux x86_64/aarch64,
macOS x86_64/arm64 and windows x86_64 plus an sdist, runs the Python test
suite against each installed wheel, and publishes to PyPI via trusted
publishing on `v*` tags. Manual runs default to a build-and-test dry run.

Rename the distribution to `bloqade-ppvm` (`ppvm` is taken on PyPI; the
import name is unchanged), fill in the package metadata, and take the
version from ppvm-python-native's Cargo.toml.

Enable AES for aarch64 Linux in .cargo/config.toml: gxhash refuses to
compile there otherwise, which would break the linux-aarch64 wheel.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Apache-2.0 requires redistributions to carry the license text and the
NOTICE file. Packaging can't reference files outside ppvm-python/, so
copy the repo-root files there and list them in `license-files`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move version, edition, license and repository into [workspace.package]
and inherit them in every crate, so the Rust crates and the bloqade-ppvm
Python package (via ppvm-python-native) release under one version.

Add a description to the 12 crates that will be published, and mark the
root examples package, ppvm-traits-2 and ppvm-python-native
`publish = false`. Symlink LICENSE and NOTICE into each published crate
so the crates.io packages carry them, as Apache-2.0 requires.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replace the tag-triggered release.yml with release-plz.yml, modelled on
vihaco. On each push to main, release-plz maintains a release PR and,
once it is merged, publishes the crates to crates.io and creates a single
`v0.x.y` tag and GitHub release. When it released, the same run builds,
tests and publishes the bloqade-ppvm wheels to PyPI. Manual runs do a
wheel dry run, with an opt-in PyPI publish for bootstrap and recovery.

release-plz.toml keeps all published crates in one version group with
`ppvm-cli` owning the tag and the root CHANGELOG.md. Pin release-plz in
mise.toml for local previews, and document the release process, including
the one-time 0.1.0 bootstrap, in the Developer Guide.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Release serialization, portable wheel CPU targeting, and release documentation need correction before publishing.

Review effort: Balanced
Findings: 2 High severity · 1 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Adds lockstep Rust/Python release automation using a shared workspace version and release-plz.

Changes:

  • Configures crates.io and PyPI publishing with tested cross-platform artifacts.
  • Renames the Python distribution to bloqade-ppvm and adds package metadata.
  • Documents releases and enables aarch64 compilation.
File Description
.cargo/​config.toml Enables aarch64 AES compilation.
.github/​workflows/​release-plz.yml Builds, tests, and publishes releases.
Cargo.toml Defines shared workspace metadata.
release-plz.toml Configures lockstep crate releases.
mise.toml Pins release-plz locally.
docs/​src/​pages/​develop.astro Documents the release process.
ppvm-python/​pyproject.toml Renames and enriches Python metadata.
ppvm-python/​uv.lock Records the renamed distribution.
ppvm-python/​LICENSE Packages licensing terms.
ppvm-python/​NOTICE Packages attribution notices.
ppvm-python/​AUTHORS Packages copyright holders.
crates/​ppvm-cli/​Cargo.toml Adds publish metadata.
crates/​ppvm-pauli-sum/​Cargo.toml Adds publish metadata.
crates/​ppvm-pauli-word/​Cargo.toml Adds publish metadata.
crates/​ppvm-python-native/​Cargo.toml Inherits version; disables publishing.
crates/​ppvm-stim/​Cargo.toml Adds publish metadata.
crates/​ppvm-sym/​Cargo.toml Adds publish metadata.
crates/​ppvm-tableau/​Cargo.toml Adds publish metadata.
crates/​ppvm-tableau-sum/​Cargo.toml Adds publish metadata.
crates/​ppvm-traits/​Cargo.toml Adds publish metadata.
crates/​ppvm-traits-2/​Cargo.toml Inherits version; disables publishing.
crates/​ppvm-tui/​Cargo.toml Adds publish metadata.
crates/​ppvm-vihaco/​Cargo.toml Adds publish metadata.
crates/​stim-parser/​Cargo.toml Adds publish metadata.
crates/​vihaco-circuit-isa/​Cargo.toml Adds publish metadata.
crates/​ppvm-cli/​LICENSE Includes the workspace license.
crates/​ppvm-cli/​NOTICE Includes workspace notices.
crates/​ppvm-pauli-sum/​LICENSE Includes the workspace license.
crates/​ppvm-pauli-sum/​NOTICE Includes workspace notices.
crates/​ppvm-pauli-word/​LICENSE Includes the workspace license.
crates/​ppvm-pauli-word/​NOTICE Includes workspace notices.
crates/​ppvm-stim/​LICENSE Includes the workspace license.
crates/​ppvm-stim/​NOTICE Includes workspace notices.
crates/​ppvm-sym/​LICENSE Includes the workspace license.
crates/​ppvm-sym/​NOTICE Includes workspace notices.
crates/​ppvm-tableau/​LICENSE Includes the workspace license.
crates/​ppvm-tableau/​NOTICE Includes workspace notices.
crates/​ppvm-tableau-sum/​LICENSE Includes the workspace license.
crates/​ppvm-tableau-sum/​NOTICE Includes workspace notices.
crates/​ppvm-traits/​LICENSE Includes the workspace license.
crates/​ppvm-traits/​NOTICE Includes workspace notices.
crates/​ppvm-tui/​LICENSE Includes the workspace license.
crates/​ppvm-tui/​NOTICE Includes workspace notices.
crates/​ppvm-vihaco/​LICENSE Includes the workspace license.
crates/​ppvm-vihaco/​NOTICE Includes workspace notices.
crates/​stim-parser/​LICENSE Includes the workspace license.
crates/​stim-parser/​NOTICE Includes workspace notices.
crates/​vihaco-circuit-isa/​LICENSE Includes the workspace license.
crates/​vihaco-circuit-isa/​NOTICE Includes workspace notices.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/release-plz.yml
Comment on lines +94 to +97
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
Comment thread docs/src/pages/develop.astro
name = "ppvm"
version = "0.1.0"
description = "Add your description here"
name = "bloqade-ppvm"
@david-pl
david-pl requested a review from Roger-luo October 6, 2026 13:22
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://QuEraComputing.github.io/ppvm/pr-preview/pr-237/

Built to branch gh-pages at 2026-10-06 14:09 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Give the release job a concurrency group so two quick merges can't race
to publish the same version. In the Developer Guide, add the internal
dependency requirements and Cargo.lock refresh to the manual bump recipe
(a minor bump otherwise fails to resolve), and use the new
`bloqade-ppvm` name in the reinstall command.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Published crates and generic aarch64 wheels currently rely on an AES configuration that is either unavailable to consumers or unsafe on CPUs without AES.

Review effort: Balanced
Findings: 2 High severity · 1 Low severity

Open (3)
Resolved since last review (2)

Comment thread .cargo/config.toml
Comment on lines +8 to +9
[target.'cfg(all(target_arch = "aarch64", target_os = "linux"))']
rustflags = ["-C", "target-feature=+aes,+neon"]

This branch has not been deployed

No deployments
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.

2 participants