🔧 fix(towncrier): match docstrfmt RST formatting expectations#1002
Merged
gaborbernat merged 1 commit intopypa:mainfrom Mar 25, 2026
Merged
🔧 fix(towncrier): match docstrfmt RST formatting expectations#1002gaborbernat merged 1 commit intopypa:mainfrom
gaborbernat merged 1 commit intopypa:mainfrom
Conversation
Towncrier generates CHANGELOG.rst with asterisks for version headers and equals signs for section headers, but docstrfmt expects hash symbols for version headers and asterisks with overlines for section headers. This mismatch caused the release script to fail with the environment inconsistency check after towncrier ran. Configure towncrier to use hash symbols for version titles and update the template to add overlines above section headers matching docstrfmt output format. This ensures the generated changelog passes pre-commit checks without modification.
henryiii
approved these changes
Mar 25, 2026
gaborbernat
added a commit
to gaborbernat/build
that referenced
this pull request
Mar 30, 2026
The 1.4.2 entry was generated before the towncrier template fix (pypa#1002), using * for version and = for sections instead of # and *. Also remove stray "Changelog" header between 1.4.1 and 1.4.0.
gaborbernat
added a commit
that referenced
this pull request
Mar 30, 2026
The 1.4.2 entry was generated before the towncrier template fix (#1002), using * for version and = for sections instead of # and *. Also remove stray "Changelog" header between 1.4.1 and 1.4.0.
gaborbernat
added a commit
to gaborbernat/build
that referenced
this pull request
Mar 30, 2026
The 1.4.2 entry was generated before the towncrier template fix (pypa#1002), using * for version and = for sections instead of # and *. Also remove stray "Changelog" header between 1.4.1 and 1.4.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The release workflow at run 23517320705 failed with the environment inconsistency check because
towncriergenerates CHANGELOG.rst with asterisks for version headers and equals signs for section headers, butdocstrfmtexpects hash symbols for version headers and asterisks with overlines for section headers. 🎨 When the release script runs, towncrier creates the changelog, then pre-commit runs docstrfmt which reformats it, causing the consistency check to fail.Configure towncrier to use hash symbols for version titles via
top_underline = "#"and update the template to add overlines above section headers. This ensures the generated changelog matches docstrfmt expectations without requiring reformatting, allowing the release script to pass the environment consistency check.The next pre-release workflow run will generate a properly formatted changelog that passes all pre-commit checks.