Skip to content

ci: publish releases via PyPI trusted publishing - #708

Draft
tobixen wants to merge 1 commit into
masterfrom
ci-trusted-publishing
Draft

ci: publish releases via PyPI trusted publishing#708
tobixen wants to merge 1 commit into
masterfrom
ci-trusted-publishing

Conversation

@tobixen

@tobixen tobixen commented Sep 3, 2026

Copy link
Copy Markdown
Member

AI-generated contents below. It will be rewritten before this pull-request leaves "draft mode".


The manual release dance was long enough that the RELEASE-HOWTO's own
list of mistakes had eight entries. Pushing a signed tag now does the
mechanical part: build, check the tarball, smoke-test the wheel, upload
over OIDC, create the github release from the tag message.

Two guards against burning a version number, since a PyPI upload cannot
be undone: workflow_dispatch runs everything except the upload, so the
workflow can be rehearsed, and the publish job sits in a pypi
environment that can be given required reviewers. Tag-signature
verification is deliberately not implemented yet - the recipe is written
down in the HOWTO for the next patch release.

The companion niquests-free alpha keeps being tagged from the laptop on
a throwaway branch; it just rides the same workflow now. Its wheel
declares no HTTP library at all, so the smoke test only demands a bare
import from the declared dependencies.

NOT MERGEABLE AS IT STANDS: trusted publishing has to be registered
under the PyPI project's settings, and caldav is owned by Cyril rather
than by me. Merging before that is done would replace a working manual
procedure with a workflow that fails at the upload step. Hence the
draft PR - the code is ready, the PyPI side is the open question.

Prompt: The RELEASE-HOWTO is a bit too combersome now. Can we set up
trusted publishing? Ideally I'd like the "3.x.ya1 should be without
niquests dependency"-logic to be embedded in the github CI workflow,
but it's difficult with testing etc, so probably best that I push
separate 3.x.ya1 and 3.x.y from the laptop (eventually this can be
scripted from the laptop side). There are some notes on how the
"trusted publishing" is set up for other projects in
/python-project-modernization and in ~/caldav-server-tester,
~/icalendar-searcher, ~/plann etc. I wouldn't like to burn a version
number now due to mistakes in the github CI workflow. I would like to
set up some protection in the CI worflow to verify that the tag is
signed by me, but that can wait until the next patch-release. It
should be documented somewhere though.
Followup-Prompt: Oh, I don't have permissions to set up trusted
publishing on pypi as the project is owned by cyril. I'll have to go
with the old workflow today.
Followup-Prompt: wouldn't it be easier to just leave the branch where it
was for future visits (maybe push it as a PR, roll back to master and
reapply my changes to the HOWTO-document? With a PR, I can eventually
ask Cyril to have a look at it. But it should be in draft mode, I'd
like to hand-edit the prose myself when I get time for it.

AI-assisted: Claude Opus 5 via Claude Code

The manual release dance was long enough that the RELEASE-HOWTO's own
list of mistakes had eight entries.  Pushing a signed tag now does the
mechanical part: build, check the tarball, smoke-test the wheel, upload
over OIDC, create the github release from the tag message.

Two guards against burning a version number, since a PyPI upload cannot
be undone: workflow_dispatch runs everything except the upload, so the
workflow can be rehearsed, and the publish job sits in a `pypi`
environment that can be given required reviewers.  Tag-signature
verification is deliberately not implemented yet - the recipe is written
down in the HOWTO for the next patch release.

The companion niquests-free alpha keeps being tagged from the laptop on
a throwaway branch; it just rides the same workflow now.  Its wheel
declares no HTTP library at all, so the smoke test only demands a bare
import from the declared dependencies.

NOT MERGEABLE AS IT STANDS: trusted publishing has to be registered
under the PyPI project's settings, and caldav is owned by Cyril rather
than by me.  Merging before that is done would replace a working manual
procedure with a workflow that fails at the upload step.  Hence the
draft PR - the code is ready, the PyPI side is the open question.

Prompt: The RELEASE-HOWTO is a bit too combersome now.  Can we set up
  trusted publishing?  Ideally I'd like the "3.x.ya1 should be without
  niquests dependency"-logic to be embedded in the github CI workflow,
  but it's difficult with testing etc, so probably best that I push
  separate 3.x.ya1 and 3.x.y from the laptop (eventually this can be
  scripted from the laptop side).  There are some notes on how the
  "trusted publishing" is set up for other projects in
  /python-project-modernization and in ~/caldav-server-tester,
  ~/icalendar-searcher, ~/plann etc.  I wouldn't like to burn a version
  number now due to mistakes in the github CI workflow.  I would like to
  set up some protection in the CI worflow to verify that the tag is
  signed by me, but that can wait until the next patch-release.  It
  should be documented somewhere though.
Followup-Prompt: Oh, I don't have permissions to set up trusted
  publishing on pypi as the project is owned by cyril.  I'll have to go
  with the old workflow today.
Followup-Prompt: wouldn't it be easier to just leave the branch where it
  was for future visits (maybe push it as a PR, roll back to master and
  reapply my changes to the HOWTO-document?  With a PR, I can eventually
  ask Cyril to have a look at it.  But it should be in draft mode, I'd
  like to hand-edit the prose myself when I get time for it.

AI-assisted: Claude Opus 5 via Claude Code

AI Prompts:
claude-sonnet-4-6: wouldn't it be easier to just leave the branch where it was for future visits (maybe push it as a PR, roll back to master and reapply my changes to the HOWTO-document?  With a PR, I can eventually ask Cyril to have a look at it.  But it should be in draft mode, I'd like to hand-edit the prose myself when I get time for it.
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