Skip to content

🔧 fix(towncrier): match docstrfmt RST formatting expectations#1002

Merged
gaborbernat merged 1 commit intopypa:mainfrom
gaborbernat:fix-towncrier-docstrfmt
Mar 25, 2026
Merged

🔧 fix(towncrier): match docstrfmt RST formatting expectations#1002
gaborbernat merged 1 commit intopypa:mainfrom
gaborbernat:fix-towncrier-docstrfmt

Conversation

@gaborbernat
Copy link
Copy Markdown
Collaborator

The release workflow at run 23517320705 failed with the environment inconsistency check because 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. 🎨 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.

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.
@gaborbernat gaborbernat added the bug Something isn't working label Mar 25, 2026
@gaborbernat gaborbernat added the bug Something isn't working label Mar 25, 2026
@gaborbernat gaborbernat merged commit 74ae997 into pypa:main Mar 25, 2026
65 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants