Skip to content

Python(chore): automate the changelog and release version bump - #825

Merged
alexluck-sift merged 9 commits into
mainfrom
al/Changelog-improvements
Oct 14, 2026
Merged

alexluck-sift merged 9 commits into
mainfrom
al/Changelog-improvements

Conversation

@alexluck-sift

@alexluck-sift alexluck-sift commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Changelog entries are now written as per-PR fragments, and a workflow opens the release PR that sets the version and renders the changelog. A release no longer needs a hand-edited version, lockfile or changelog.

Changelog

  • Every PR that changes python/ adds a fragment in python/changelog.d/, and CI enforces it. An empty <PR>.chore.md means no user-visible change. See python/changelog.d/README.md.
  • CHANGELOG.md is added to the docs site, and each GitHub Release includes its version's section.

Release flow

  • Python Release Prep is run manually. It computes the next version from the current version and the fragment types, sets it in pyproject.toml and uv.lock with uv version, renders the changelog and opens a PR for review.
  • Merging that PR runs Python Release Tag, which tags the new pyproject.toml version as python/vX.Y.Z and starts PyPI Publish. If another python/ change merges while the release PR is open, the changelog check warns on the release PR and Release Tag refuses to tag until the leftover fragments are in the changelog. PyPI Publish also checks that a stable tag matches pyproject.toml before CI runs.
  • The repo setting that lets Actions create pull requests must be on. PRs opened with the default token do not trigger required checks, so the release PR may need a re-run or an app token.

Verification

  • Ran uv version --no-sync locally. It changes only the version line in pyproject.toml and uv.lock.
  • Rendered a sample release against the current changelog. Old entries are unchanged.
  • Built the docs site with the changelog page.
  • The new workflows have not run yet. The first release exercises them.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-825/

Deployed from be356a1. The link may take up to a minute to become live as GitHub Pages propagates.

@alexluck-sift alexluck-sift changed the title Python(chore): derive version from git tags and automate the changelog Python(chore): automate the changelog and release version bump Oct 12, 2026
@alexluck-sift
alexluck-sift marked this pull request as ready for review October 12, 2026 21:29
The Python version now comes from `python/v*` tags through setuptools-scm, so
nothing is bumped in `pyproject.toml` or `uv.lock`. Changelog entries are
per-PR fragments in `python/changelog.d`, rendered into `CHANGELOG.md` at
release time. A release prep workflow opens the changelog PR, and merging it
creates the tag and starts the PyPI publish workflow. The changelog also
appears on the docs site and in the GitHub Release notes.
Bump mkdocstrings to 1.0.7, which works with pymdown-extensions 12.2, and
raise the docs extras to Python 3.11. Keep tests out of the wheel, drop the
unreachable 0.0.0 guard, and document merging the release PR first.
Drop setuptools-scm and keep the version in pyproject.toml. Release Prep
sets it with uv version alongside the rendered changelog, and Release Tag
tags the version in pyproject.toml once it merges.
Fail a release PR whose merge result still has fragments, and fail a tag
build with leftover fragments before it reaches PyPI.
release_version.py now reads the version and fragment rules from
pyproject.toml and adds --current and --leftover. Release Tag refuses to
tag with leftover fragments, PyPI Publish checks stable tags before CI,
and python_build.yaml matches main again. The changelog check fetches two
commits and runs towncrier through uvx.
@alexluck-sift
alexluck-sift force-pushed the al/Changelog-improvements branch from a927475 to b3018fa Compare October 12, 2026 21:35
Docs CI now installs from uv.lock, so mkdocstrings 1.0.3 and the Python
3.10 floor for the docs extras stay as they are on main.
Comment thread .github/workflows/python_release.yaml
Comment thread python/changelog.d/README.md Outdated
@alexluck-sift
alexluck-sift force-pushed the al/Changelog-improvements branch from 62a0482 to a53d407 Compare October 13, 2026 22:53
Comment thread .github/workflows/python_release_tag.yaml Outdated
@wei-sift
wei-sift self-requested a review October 13, 2026 23:01

@wei-sift wei-sift left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alexluck-sift
alexluck-sift enabled auto-merge (squash) October 14, 2026 04:32
@alexluck-sift
alexluck-sift merged commit dc06664 into main Oct 14, 2026
27 checks passed
@alexluck-sift
alexluck-sift deleted the al/Changelog-improvements branch October 14, 2026 04:33
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