Skip to content

ci: let the deploy job publish to PyPI with trusted publishing - #961

Merged
ajslater merged 2 commits into
developfrom
pypi-trusted-publishing
Sep 30, 2026
Merged

ajslater merged 2 commits into
developfrom
pypi-trusted-publishing

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Summary

This is Phase 2 of moving PyPI publishing to trusted publishing (OIDC).

  • update devenv: brings in the new devenv-pypi action from ajslater/devenv#20.
    • With a token, it publishes as before.
    • With an empty token, it runs uv publish --trusted-publishing always.
  • deploy job: now grants id-token: write, alongside contents: read and packages: write. PyPI still publishes after the image manifest. The job keeps passing secrets.PYPI_TOKEN, so nothing changes until that secret is deleted. After that, it publishes with trusted publishing, using the publisher already registered on PyPI (ajslater/codex, ci.yml).
  • tests/test_ci_workflow.py: a new test pins the permission.

Known pre-existing lint failure (not from this PR)

make lint fails in vulture on node_modules/katex/src/fonts/generate_fonts.py, and it fails the same way on develop.

  • katex arrived with develop's last "update devenv" commit, through micromark-extension-math.
  • vulture matches exclude patterns against absolute file paths, so devenv's **/node_modules pattern never excluded anything.
  • The fix belongs in devenv's pyproject template: use */node_modules/*. With that exclude, vulture passes here.

The Lint combo in this PR's CI will be red until that fix reaches codex through update-devenv.

Test plan

  • make test: 1575 passed, 1 xfailed.
  • actionlint is clean.
  • make lint passes except for the pre-existing vulture issue above.
  • After merge and release, delete PYPI_TOKEN. The next publish should log trusted publishing.

🤖 Generated with Claude Code

ajslater and others added 2 commits September 29, 2026 18:36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grant id-token: write to the deploy job, which runs devenv-pypi after the
image manifest. devenv-pypi now publishes with PyPI trusted publishing
once the PYPI_TOKEN secret is deleted, and that needs the job to be able
to get a GitHub identity token. While the secret exists it still
publishes with the token. A new test pins the permission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit d85156c into develop Sep 30, 2026
9 checks passed
@ajslater
ajslater deleted the pypi-trusted-publishing branch October 6, 2026 20:45
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.

1 participant