Skip to content

Move release notes extraction to an invoke task - #166

Merged
MatthijsBurgh merged 1 commit into
ci/create-github-releasefrom
ci/release-notes-task
Nov 10, 2026
Merged

MatthijsBurgh merged 1 commit into
ci/create-github-releasefrom
ci/release-notes-task

Conversation

@MatthijsBurgh

Copy link
Copy Markdown
Contributor

Follow-up to #165, targeting its branch.

Changes

  • Inline Python → invoke release-notes. The changelog → Markdown conversion moves out of the heredoc in release.yml into tasks.py, next to prepare_changelog and the bump2version setup that already own the changelog format. The workflow step is now one line. Maintainers can preview the notes locally before tagging:
    invoke release-notes --tag v2.1.0 [--output release-notes.md]
    
  • Extract notes before building/publishing. Previously the step ran after the PyPI upload, so a missing changelog section left a PyPI release without a GitHub Release, which is the state Create GitHub Releases from the release workflow #165 sets out to fix. It now fails before anything is published.
  • No silently dropped content. The old parser kept only * bullets and indented continuations and silently discarded anything else (e.g. a plain paragraph). It now fails with the offending line number. Nested bullets keep their indentation instead of being glued to the parent item. A section with no entries at all also fails, which catches a forgotten changelog. Drop that check if a release without entries should be allowed.

Verification

  • invoke release-notes --tag v2.1.0 output is identical to the published v2.1.0 release body (minus GitHub's generated "Full Changelog" line).
  • All 28 sections of CHANGELOG.rst convert without errors.
  • A missing version (--tag v9.9.9) exits with status 1. Paragraph text, text outside a group, and empty sections raise errors as intended.
  • flake8 reports nothing on the new code.

🤖 Generated with Claude Code

The changelog to Markdown conversion moves from an inline Python heredoc
in release.yml to an `invoke release-notes` task in tasks.py, next to the
other changelog tooling. It can now be run locally to preview the notes.

The conversion now fails on lines it cannot convert (paragraphs, text
outside a group) and on sections without entries, instead of silently
dropping them. Nested bullets are kept.

The notes are extracted before building and publishing, so a missing or
broken changelog section stops the release before it reaches PyPI.

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

@gonzalocasas gonzalocasas 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!

@MatthijsBurgh
MatthijsBurgh merged commit f169e3e into ci/create-github-release Nov 10, 2026
@MatthijsBurgh
MatthijsBurgh deleted the ci/release-notes-task branch November 10, 2026 10:08
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