Skip to content

Use towncrier for changelog entries - #620

Merged
tompollard merged 3 commits into
MIT-LCP:mainfrom
TheNetherWatcher:towncrier
Nov 1, 2026
Merged

tompollard merged 3 commits into
MIT-LCP:mainfrom
TheNetherWatcher:towncrier

Conversation

@TheNetherWatcher

Copy link
Copy Markdown
Contributor

As discussed in #606: each change now adds its own file in changelog.d/ instead of editing docs/changes.rst, so pull requests no longer conflict on the changelog.

  • Fragments are plain .rst files named after the change (for example rr2ann-fixes.rst), in the same bold-heading format as now. changelog.d/README.rst explains this.
  • At release time, uv run towncrier build --version X.Y.Z --date "Mon YYYY" adds a Version X.Y.Z (Mon YYYY) section to docs/changes.rst and deletes the fragments. Entries are sorted by file name.
  • The 25 existing unreleased entries are moved into changelog.d/ unchanged. I checked that towncrier build --draft reproduces them exactly, and ran a real build on a copy: the docs build passes with -W both before and after.
  • towncrier is pinned in the dev group, like Ruff. AGENTS.md and DEVELOPING.md are updated.

One trade-off: the unreleased changes no longer show on the docs site until a release. If you'd like them there, sphinxcontrib-towncrier can render a draft section, but that touches docs/conf.py, so I'd do it after #616.

#619 and #583 add entries to docs/changes.rst, so they'd need to move them into a fragment after this is merged (or the other way round, whichever goes in first).

Each change now adds its own file in changelog.d instead of editing
docs/changes.rst, so pull requests no longer conflict on the changelog.
towncrier build collects the entries into docs/changes.rst at release
time, in the same format as before. The existing unreleased entries are
moved into changelog.d unchanged.
@tompollard

Copy link
Copy Markdown
Member

Thanks, this looks great! The draft build reproduces the current entries exactly, and a real build plus the docs build with -W both pass.

A few suggestions:

  1. A fragment with the wrong extension (for example foo.md, or no extension) is silently skipped, so it would never reach the changelog. Setting ignore makes towncrier reject unrecognised files instead:

    ignore = ["README.rst", "template.rst.jinja"]
  2. Optionally, adding uv run towncrier build --draft --version 0 > /dev/null to the style check would catch a bad fragment in the pull request that adds it, rather than at release time.

  3. In DEVELOPING.md, it might be worth saying that the version must be bumped before running towncrier build. If --version is left out, towncrier takes it from pyproject.toml, and with the old version it quietly adds a second Version 4.3.1 section. Leaving out --version and relying on pyproject.toml would also work, since that's where the version is set anyway.

Small note on the description: entries aren't strictly sorted by file name. towncrier puts names containing a digit last (ann2rr-…, csv2ann-…, rr2ann-…), which is fine.

Move the changelog entries added on main (remote FLAC requests, and
multi-segment records in archives) into changelog.d.
Without an ignore list, towncrier silently skips files that are not
valid fragments, so an entry with the wrong extension would never reach
the changelog. List the files to ignore, so that any other file is an
error, and run a draft build in the style check to catch this in the
pull request that adds the entry.

The release steps now take the version from pyproject.toml, where it is
bumped in the first step, rather than giving it again on the command
line.
@tompollard

Copy link
Copy Markdown
Member

Thanks again for this! To get it merged quickly (since a few open PRs are waiting on it), I've merged main into the branch, moved the new entries from #583 and #621 into changelog.d/, and added the ignore setting, a draft build in the style check, and the version note in DEVELOPING.md.

@tompollard
tompollard merged commit 6d23e79 into MIT-LCP:main Nov 1, 2026
18 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