Open
Conversation
Composite action (build/actions/python/action.yml): - Input validation with globbing disabled - uv detection (uv.lock → uv sync/build/run) with PEP 517 fallback - Python version auto-detected from pyproject.toml via setup-python - pytest gating (skips gracefully if no tests found) - SPDX SBOM via syft - Artifact hash computation for SLSA generator Reusable workflow (build_and_publish_python.yml): - Three-job architecture: build (contents:read only) → publish (id-token:write, non-PR) → provenance (SLSA L3, non-PR) - PyPI Trusted Publishing via OIDC (no secrets) - PEP 740 Sigstore attestations on publish - SLSA L3 provenance via slsa-github-generator (tag ref per #147) Also adds: - 19 structural tests (build/actions/python/test.bats) - Workflow example (gh_workflow_examples/build_python.yml) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous commit added the action but the workflow referenced the parent SHA where the action didn't exist yet. Update to the commit that contains the action. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
Integration test resultsAlmost everything works — major progress:
Publish failure: PyPI Trusted Publishing does not support reusable workflowsPyPI's OIDC token validation rejects tokens from reusable workflows — the claims differ from direct workflows. This means This is a fundamental architectural constraint: the publish step cannot live inside the reusable workflow. It needs to run directly in the adopter's workflow, or PyPI needs to add reusable workflow support. Investigating options. |
PyPI Trusted Publishing does not support reusable workflows — the OIDC token's workflow_ref must point to the adopter's own workflow. (pypi/warehouse#11096, open since 2022, no timeline) Changes: - Reusable workflow is now build-only: build, test, SBOM, hash computation. Exports hashes and version outputs. - Remove publish and provenance jobs from reusable workflow. - Workflow example (gh_workflow_examples/build_python.yml) includes publish + SLSA provenance jobs directly — adopters copy this and configure their Trusted Publisher against their own workflow file. - Update structural tests to verify build-only architecture. - Update companion template to build-only with minimal permissions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document the PyPI Trusted Publishing limitation and the split architecture: wrangle owns build/test/SBOM, adopter owns publish. Reference #157 for when to revisit. Co-Authored-By: Claude Opus 4.6 (1M context) <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
Implements the Python build type spec from #151. Three-job architecture with minimal permissions on the build step, PEP 740 attestations on publish, and SLSA L3 provenance.
Files
build/actions/python/action.yml.github/workflows/build_and_publish_python.ymlbuild/actions/python/test.batsgh_workflow_examples/build_python.ymlManual steps required before end-to-end testing
wrangle-test-fixture(or similar) at https://test.pypi.orgTomHennen/wrangle-testtest-wrangle.yml(the generated workflow on integration branches)tomhennen/wrangle-test):test-pythonjob pointing atbuild_and_publish_python.ymlwithrepository-url: https://test.pypi.org/legacy/build_and_publish_python.ymlto include the composite action (one-commit-lag, same as other build types)What this PR does NOT include
Test plan
./test.shpasses (164 tests — 19 new)🤖 Generated with Claude Code