Repository navigation
Closed
0 / 10 of 1 issue completedClosed
[SPIKE] Publish lane: PyPI (Trusted Publishing, PEP 740 attestations, pure + PyO3/maturin wheels)#1772
0 / 10 of 1 issue completed
Copy link
Labels
Description
Parent spike: #1769. Research the 2026 best practice for publishing Python distributions (pure-Python and PyO3/maturin native wheels) to PyPI and decide what devkit manages.
Motivation / why
The org has pure-Python repos and Rust+Python (pyo3 abi3) repos (tessera). Both need PyPI with no long-lived tokens and with attestations. Nothing exists today beyond a comment in the publish seam stub.
Proposed approach (strawman)
- Trusted Publishing via
pypa/gh-action-pypi-publish(PEP 740 attestations on by default) — oruv publishwith OIDC; decide which is the 2026 default. - Build:
uv buildfor pure Python;maturin(orPyO3/maturin-action/ cibuildwheel / nix-built abi3 wheel) for native — build stays a project recipe; wheels also land on the GitHub Release in the assets window. - RCs → PyPI prerelease (
X.Y.ZrcN) or TestPyPI — decide.
What already exists
publish-release-extension.yml stub (on dev), uv-based toolchain in the image, docs/rfcs/ADR-uv2nix-pyproject-nix.md, DEVKIT_PRERELEASE_FORMAT (#1746).
Scope / questions
- PyPI Trusted Publishing and reusable workflows: supported in 2026? If not, the managed publish workflow must be top-level.
-
gh-action-pypi-publishvsuv publish --trusted-publishing— attestations parity? - Native wheels: manylinux/musllinux/macOS/Windows matrix — cibuildwheel vs maturin-action vs nix; what should devkit template?
- Version mapping: train
1.2.3-rc1→ PEP 4401.2.3rc1; where does the version get written (pyproject.toml, dynamic via VCS)? - PEP 639 license metadata, sdist inclusion — any 2026 gates?
Pitfalls
- A version on PyPI can never be re-uploaded, even after deletion.
- PyPI rejects non-PEP 440 versions; a SemVer prerelease string fails late.
- Pending publishers: first-time project creation via Trusted Publishing needs a pending publisher set up by a human.
- Wheel built in the assets window vs. uploaded after
release: publishedmust be the same bytes (attestation continuity).
Acceptance criteria
- Dated verdict (verified-on / verified-how) on the 2026 best practice for this channel, with primary sources (registry docs, official actions)
- Gap table: best practice vs. what devkit ships today
- Concrete split: devkit owns (managed) / devkit seeds (template) / repo owns (build recipe, registry registration)
- Prerelease policy for this channel decided
- Implementation issue(s) filed, or an explicit "won't do" with reason
References
Parent: #1769 · #1746 · #1748 · #1523 · #1519 · docs/DOWNSTREAM_RELEASE.md (on dev)
Sub-issues
Collapse Sub-issuesSub-issues
Loading 1 sub-issues
Activity
gerchowl commentedon Sep 29, 2026
Verdict
pypa/gh-action-pypi-publish, notuv publish. uv does OIDC but does not generate PEP 740 attestations, so the two are not at parity.PyO3/maturin-actionbuilds, the PyPA action uploads.maturin generate-ciemitsuv publishand so loses attestations; treat it as a starting template only.hatch-vcs/setuptools-scm/uv-dynamic-versioning) and written as PEP 440 (1.2.3rc1).--preis passed.Split
attestations: true) and the skip-if-exists precheck.just dist-pypirecipe (uv build, or a maturin matrix) and apyproject.tomlskeleton with a dynamic version backend and a PEP 639 licence expression.New pitfalls
DEVKIT_PRERELEASE_FORMATvalues have no PEP 440 spelling:nightly.YYYYMMDD.Nis unmappable andbetawithout N is invalid. devkit must refuse these, or normalise them, before publish.Licenseor PEP 639License-Expression, not both; mixing them is rejected.Sources: pypi-publish README · uv publish · maturin distribution · PEP 440 · TestPyPI
c-vigo commentedon Sep 30, 2026
Spike complete. The dated verdict is in the review above; the cross-cutting decision is recorded in
docs/rfcs/ADR-publish-lanes.md(PR #1785, merged todevas 36e74cc), per #1769's rule that the channel spikes close when the ADR lands.Implementation continues in: #1779 (PyPI lane) (lane foundation: #1778).