ci: add PyPI trusted publishing (abi3 wheels, v0.2.1)#123
Open
abimaelmartell wants to merge 4 commits into
Open
ci: add PyPI trusted publishing (abi3 wheels, v0.2.1)#123abimaelmartell wants to merge 4 commits into
abimaelmartell wants to merge 4 commits into
Conversation
Adds publish-pypi.yml mirroring the npm/crates.io pattern: triggers on Cargo.toml version change, builds wheels for 5 platforms via maturin, publishes with OIDC trusted publishing (no tokens). workflow_dispatch serves as a manual fallback for the first run after the PyPI project transfer. Enables pyo3 abi3-py38 so one wheel per platform covers CPython >=3.8 (previous manual uploads were cp312-only). Bumps version to 0.2.1 since PyPI already has 0.2.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Review feedback: trusted publishing doesn't match on branch, so workflow_dispatch needed an explicit main-ref guard. Manual dispatch now always rebuilds and publishes with skip-existing so a release that failed after uploading only some wheels can be completed by re-running. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Both review findings addressed in 89b20d5:
|
Decouple the Python package version from the crate version, matching how npm publishing keys off napi/package.json: bump [project] version in pyproject.toml manually and CI publishes on merge. Reverts the Cargo.toml bump so this PR no longer triggers a crates.io release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sets up automated PyPI publishing so
pdf-inspectorreleases stop depending on manual uploads from a personal machine. Same trusted-publishing (OIDC) pattern as our npm and crates.io workflows — no API tokens anywhere.publish-pypi.yml: triggers when the[project]version inpyproject.tomlchanges on main — same flow as npm publishing keying offnapi/package.json. Builds wheels for linux x86_64/aarch64, macOS x86_64/arm64, windows x64 + sdist via maturin, publishes withpypa/gh-action-pypi-publishusing OIDC.workflow_dispatch(main-only) is a manual fallback that also repairs partially-uploaded releases viaskip-existing.pyproject.tomlnow carries its own staticversion(set to 0.2.1 — PyPI is already at 0.2.0, published outside this repo, so anything ≤0.2.0 would be ignored by pip). Bump it manually to release; the crate version in Cargo.toml is untouched by this PR.abi3-py38): one wheel per platform now covers all CPython ≥3.8. The previous manual uploads were cp312-only, so users on 3.10/3.11/3.13 were building from source.Verification
cargo fmt/cargo clippy --features python -- -D warnings/cargo testall passpdf_inspector-0.2.1-cp38-abi3(static pyproject version wins over Cargo's 0.1.4), type stubs (pdf_inspector.pyi) included by maturintests/test_python.py— 63 passed🤖 Generated with Claude Code