Skip to content

Release the Python packages with verwalter - #962

Open
lukasIO wants to merge 6 commits into
mainfrom
claude/verwalter-0be38d
Open

lukasIO wants to merge 6 commits into
mainfrom
claude/verwalter-0be38d

Conversation

@lukasIO

@lukasIO lukasIO commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Two scripts release the three packages today: changesets.py and update_versions.py. Five workflows around them hold about 1,100 lines of bash and Python. Each release opens a hand-built PR, tags it, and uploads to PyPI. Contributors must learn eight custom changeset types, such as next-rc and promote, and a second manual flow that conflicts with the first. This PR replaces both flows with verwalter. verwalter is the changeset release tool that other LiveKit repositories use.

Change

  • verwalter.toml lists livekit (in livekit-rtc/), livekit-api and livekit-protocol. Each package keeps its tag format (rtc-v…, api-v…, protocol-v…) and reads its version from version.py.
  • release-pr.yml keeps one release PR, release/main, current on each push to main. pre-release.yml opens an rc PR by hand. Both open the PR with the verwalter-release App.
  • package-release.yml runs when the release PR merges. It keeps its old file name, so the PyPI trusted publishers need no change. A gate job (verwalter gate) lets only a merged PR from verwalter-release[bot] release. A run by hand must start from main, release a commit on main, and name a known package. gate resolves the commit once, and every later job checks out that commit. The workflow then builds every package, with the rtc wheels on 5 platforms. Next, it tags and creates draft GitHub releases. verwalter publish then uploads each package with twine upload --attestations --skip-existing and trusted publishing, dependencies first. A failed package blocks only its dependents, and a package whose source changed since its tag fails with the repair command. Each package's publish.exists_url in verwalter.toml points at its sdist: a version counts as published when its sdist is on PyPI, and twine uploads the sdist last. So a half upload stays a draft, and a re-run uploads the missing files. Docs deploy for each release that is public after the publish, only for the newest final tag of a package, built from that tag.
  • changeset-check.yml replaces the changeset validation and the reminder comment, and still skips renovate/* PRs. On the release PR, it builds each package that the merge releases and runs twine check, so a package that PyPI rejects fails before the merge.
  • release-gate.yml stays, because it is a required check and it enforces 2 approvals. It now counts only approvals of the head commit: a push to main regenerates the release PR, and an approval of an older commit must not release the new content.
  • build-rtc.yml, build-api.yml and build-protocol.yml no longer publish to PyPI on a tag push. That path failed in its last four runs, and with the App every release tag would start it. package-release.yml is now the only path to PyPI.
  • RELEASING.md describes the release and the repair commands. .changeset/README.md describes the new levels.

For contributors, these things change:

  • Changesets name livekit, not livekit-rtc.
  • The only levels are patch, minor and major. Pre-releases come from pre-release.yml.
  • A livekit-protocol release also releases livekit-api as a patch, and moves its livekit-protocol requirement. A major rc of livekit-protocol needs an extra livekit-api patch changeset (pre-release: a major rc leaves out dependents whose requirement excludes it verwalter#137).
  • Each package gets a CHANGELOG.md, starting with its next release.

The workflows are pinned to verwalter v0.32.0-rc.2 by commit, like the other actions in this repository. 0.32 reads the dependency from pyproject.toml (livekit/verwalter#128), writes an rc as 2.1.0rc1 in version.py (livekit/verwalter#129), and uses the PEP 440 form in a PyPI exists_url (livekit/verwalter#138).

Failure case

A wheel build can fail on one platform. All builds run before the tag, so a failed build stops the release before any tag or upload exists. An upload can also stop halfway. The sdist is then not on PyPI, so the release stays a draft. A re-run of the publish job runs twine again, and --skip-existing uploads only the missing files.

Verified

  • With verwalter 0.32.0-rc.2, verwalter plan and verwalter status show no warnings. All three packages match their last tag, and PyPI has each version.
  • A test major changeset for livekit-protocol gave a local release branch with livekit-protocol 3.0.0 and livekit-api 2.0.2. The requirement in livekit-api/pyproject.toml moved from >=2.0.1,<3.0.0 to >=3.0.0,<4.0.0.
  • The dry run commands pass locally: uv build and twine check for livekit-api and livekit-protocol, and the sdist of livekit.
  • The new approval count gives 2 for livekit-api v2.0.1 #956 and Release: livekit v1.3.0 #953, the same as the old count, and 0 for a head commit with no review.
  • The guard of a run by hand refuses a commit that is not on main and allows rtc-v1.3.0.
  • With a temporary config that points at livekit-agents, verwalter status finds the rc 1.6.0-rc.2 through livekit_agents-1.6.0rc2.tar.gz (registry:yes).
  • verwalter status finds each sdist on PyPI (registry:yes), and verwalter publish --dry-run reports all three as on the registry, livekit-protocol before livekit-api. The sdist URL answers 404 for a version that does not exist. twine 7.0.0 sorts wheels before the sdist (_group_wheel_files_first) and supports trusted publishing.
  • The docs filters, run against the real tags and releases: only the newest final tag per package, and only a public release.
  • With a local test remote, a livekit-protocol: major rc leaves livekit-api at <3.0.0. With an extra livekit-api: patch changeset, the rc moves it to >=3.0.0rc1,<4.0.
  • actionlint passes on every workflow.

For reviewers

Before the first release, someone with admin access must do these steps:

  1. Make sure that the verwalter-release App is installed on this repository. The organization secrets are already available to it. Without the App, release-pr.yml cannot open the release PR, and gate releases nothing.
  2. Create the internal label and add it to this PR. A PR with this label needs no changeset.

Not done yet

🤖 Generated with Claude Code

Replace changesets.py, update_versions.py and the Package Release,
Manual Version Bump, Changeset and Changeset Reminder workflows with
verwalter.toml and the verwalter workflows. Keep the release gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukasIO lukasIO self-assigned this Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 This PR has no changeset. If it should be released, add a markdown file under .changeset/ (any name, e.g. .changeset/fix-token-parsing.md):

---
"livekit-rtc": patch
---

Short description of the change, used in the release notes.
  • Packages: livekit-rtc, livekit-api, livekit-protocol (one line per package)
  • Types: patch, minor, major, patch-rc, minor-rc, major-rc, next-rc, promote

If this change doesn't need a release (docs, CI, tests), you can ignore this comment.

lukasIO and others added 2 commits November 23, 2026 10:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Use `verwalter gate` in place of the hand-written guard. A run by hand
  releases only a commit on main.
- Dry-run the PyPI build and `twine check` on the release PR.
- Drop the explicit dependency: 0.32 reads it from pyproject.toml and
  moves the requirement.
- Remove the tag-triggered PyPI publish from build-*.yml.
- Count only approvals of the head commit in the release gate.
- Build the docs from the released commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukasIO
lukasIO marked this pull request as ready for review November 23, 2026 12:30
devin-ai-integration[bot]

This comment was marked as resolved.

- Resolve the release commit once in `gate` and check it out in every
  job, so a branch name in `ref` cannot move between jobs.
- Reject an unknown `package` input. Upload and publish only releases
  whose tag exists and whose source matches the tag. Drop the fallback
  that uploaded every package.
- Deploy docs only for the newest final tag of a package, built from
  that tag.
- Document the extra livekit-api changeset for a major livekit-protocol rc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

- Run twine with attestations as the publish command, so `publish` owns
  the order, blocks the dependents of a failed package, and refuses
  source that changed since the tag. Drop the upload filter and the
  pypa steps.
- Check PyPI as a custom registry through the sdist, which twine
  uploads last, so a half upload stays a draft and a re-run completes it.
- Deploy docs for each release that is public after the publish, also
  when another package failed.
- TODOs for livekit/verwalter#137 and #138.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Back to the `pypi` registry: each package's `exists_url` now replaces
  the built-in check, with `{version}` in PEP 440 form, so the sdist
  check also works for an rc (livekit/verwalter#138).
- Pin v0.32.0-rc.2 and remove the #138 TODOs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant