Skip to content

Set up PyPI publishing via trusted publishing#4

Merged
MattFisher merged 3 commits into
mainfrom
claude/pypi-publishing
Jul 18, 2026
Merged

Set up PyPI publishing via trusted publishing#4
MattFisher merged 3 commits into
mainfrom
claude/pypi-publishing

Conversation

@MattFisher

@MattFisher MattFisher commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Publishes inspect-dataset to PyPI on v* tag pushes via trusted publishing (OIDC — no API tokens stored).

What's included

  • .github/workflows/release.yml — on tag push: verify the tag matches the pyproject version, uv build, uv publish --trusted-publishing always under a pypi environment with id-token: write. Actions are hash-pinned per the zizmor policy; the workflow has concurrency limits and disables setup-uv cache restore in the publish job (cache-poisoning hardening).
  • MIT licenseLICENSE file plus PEP 639 metadata (license = "MIT", license-files); the wheel carries License-Expression: MIT and bundles the license text.
  • Package size fix — setting this up surfaced that the wheel was silently 66 MB / 14,227 files: the frontend's node_modules was being swept into both sdist and wheel. Excluded via the uv build backend; the wheel is now 2 MB with the built viewer bundle and frontend sources intact (verified by inspecting the archives).
  • README release procedure; .copier-answers.yml records publish_to_pypi: true, license: MIT.

One-time manual step (owner only)

Register a Trusted Publisher at https://pypi.org/manage/account/publishing/ — repository Generality-Labs/inspect_dataset, workflow release.yml, environment pypi. The inspect-dataset name is currently unclaimed on PyPI, so this can be a pending publisher.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LLg5cbBcfNyyrRGJVPfsA6

claude added 3 commits July 18, 2026 11:43
- .github/workflows/release.yml: on v* tag push, verify the tag matches
  the package version, uv build, uv publish with OIDC trusted publishing
  (environment: pypi). One-time PyPI-side setup documented in the
  workflow header and README.
- Exclude node_modules from sdist and wheel — the wheel was silently
  66 MB / 14k files before; it is now 2 MB with the built viewer bundle
  and frontend sources intact.
- README: release procedure; .copier-answers.yml: publish_to_pypi true.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLg5cbBcfNyyrRGJVPfsA6
LICENSE file plus PEP 639 metadata (license = "MIT", license-files);
the wheel now carries License-Expression: MIT and bundles the license
text. Copier answers updated to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLg5cbBcfNyyrRGJVPfsA6
Add workflow concurrency (one release at a time, no cancel-in-progress),
name the publish job, and disable setup-uv cache restore in the publish
job so a poisoned cache cannot tamper with what gets uploaded to PyPI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LLg5cbBcfNyyrRGJVPfsA6
@MattFisher
MattFisher merged commit 3da9837 into main Jul 18, 2026
1 check passed
@MattFisher
MattFisher deleted the claude/pypi-publishing branch July 18, 2026 21:57
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