Skip to content

Guard release version info against typos and desync - #473

Merged
Zac-HD merged 1 commit into
python-trio:mainfrom
Zac-HD:claude/version-info-sync-tests-0gnwuj
Jul 28, 2026
Merged

Guard release version info against typos and desync#473
Zac-HD merged 1 commit into
python-trio:mainfrom
Zac-HD:claude/version-info-sync-tests-0gnwuj

Conversation

@Zac-HD

@Zac-HD Zac-HD commented Jul 28, 2026

Copy link
Copy Markdown
Member

Release 27.7.1 escaped with a year-typo'd changelog header while __version__ still said 26.6.1: CI only checked that the changelog head was >= __version__, and the release job's update_version() silently patched the workspace copy before tagging and uploading (#469).

  • New always-on check: the newest changelog version may never be dated in the future, and its month must be a valid calendar month.
  • In --ensure-tag (release) mode, require the changelog head, __version__, and the usage.rst pre-commit rev to be exactly equal, and no longer run update_version() there - a mismatch now fails the release instead of being patched on the fly. Pre-commit keeps the auto-fix behavior.
  • Before creating a new tag for a x.y.1 release, require its year.month to be the current (or immediately previous) month; patch releases of an existing series are exempt. Tag existence is now checked via ls-remote, since a shallow CI checkout has no local tags.
  • Rename the 27.7.1 changelog entry to the intended 26.7.1 and sync version and the usage.rst example accordingly.

Merging this PR will re-release as 26.7.1, closing #469, and I'll then yank the bad release on PyPI.

Release 27.7.1 escaped with a year-typo'd changelog header while
__version__ still said 26.6.1: CI only checked that the changelog head
was >= __version__, and the release job's update_version() silently
patched the workspace copy before tagging and uploading (python-trio#469).

- New always-on check: the newest changelog version may never be dated
  in the future, and its month must be a valid calendar month.
- In --ensure-tag (release) mode, require the changelog head,
  __version__, and the usage.rst pre-commit rev to be exactly equal,
  and no longer run update_version() there - a mismatch now fails the
  release instead of being patched on the fly. Pre-commit keeps the
  auto-fix behavior.
- Before creating a new tag for a x.y.1 release, require its year.month
  to be the current (or immediately previous) month; patch releases of
  an existing series are exempt. Tag existence is now checked via
  ls-remote, since a shallow CI checkout has no local tags.
- Rename the 27.7.1 changelog entry to the intended 26.7.1 and sync
  __version__ and the usage.rst example accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cqsspf84UPK1Gg5rka8hRz
@Zac-HD
Zac-HD merged commit 6392dec into python-trio:main Jul 28, 2026
10 checks passed
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