Skip to content

Set up Towncrier for managing release notes - #95

Merged
tarasko merged 6 commits into
aio-libs:masterfrom
tarasko:towncrier
Sep 30, 2026
Merged

tarasko merged 6 commits into
aio-libs:masterfrom
tarasko:towncrier

Conversation

@tarasko

@tarasko tarasko commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What do these changes do?

Set up Towncrier for managing release notes. This PR has minimal necessary changes. Not everything from #82

For now:

  • Custom towncrier jinja template from pip-tools is not used. aiofastnet doesn't have or generate docs at this moment. A standard towncrier template is used.

  • No tox-towncrier + reusable-tox.yml for self-checks.

Are there changes in behavior for the user?

No

Is it a substantial burden for the maintainers to support this?

No

Related issue number

#82

Checklist

  • Add a new news fragment into the docs/changelog.d/ folder

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (03b243d) to head (133fa5a).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #95      +/-   ##
==========================================
- Coverage   91.31%   91.28%   -0.04%     
==========================================
  Files          19       19              
  Lines        3257     3257              
  Branches       38       38              
==========================================
- Hits         2974     2973       -1     
- Misses        272      273       +1     
  Partials       11       11              
Flag Coverage Δ
Linux 88.49% <100.00%> (ø)
Windows 81.96% <100.00%> (ø)
macOS 85.43% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
aiofastnet/__init__.py 100.00% <100.00%> (ø)
aiofastnet/_version.py 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 41 untouched benchmarks


Comparing tarasko:towncrier (133fa5a) with master (53bf964)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Replaces custom changelog tool with Towncrier.

No outstanding issues identified; this review does not require changes before merging.

Reviews (3) · Last reviewed commit: "Use PR id instead of issue id"

{{- '\n\n' -}}

{%- if pr_issue_numbers %}
*PRs and issues:* {issue}`{{ pr_issue_numbers | join('`, {issue}`') }}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Release links appear as text

The template puts {issue} and {commit} roles into notes that the workflow sends to GitHub. GitHub displays the roles as text instead of links; the new fragment’s {user} role behaves the same way. Readers must look up the related work and contributors themselves. Use GitHub-compatible Markdown links.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Artifacts

Executed Towncrier and GitHub rendering check

  • This authored script runs the draft build and submits the original and link-converted notes to GitHub’s Markdown API, making the comparison reproducible.

GitHub rendering of unchanged release notes

  • The executed draft build and GitHub response show zero links and literal role markers in the unchanged notes, confirming the defect.

GitHub rendering with counterfactual Markdown links

  • The same executed check converts roles to Markdown links without editing tracked code; GitHub then links the issue, user, and synthetic commit.

View artifacts

T-Rex Ran code and verified through T-Rex

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greptile-apps memorize that this is a special case for future MyST-Parser and Sphinx integration that does not directly concern GitHub. Any GFM-limited content must be pre-processed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it — I’ll treat this as a special case for MyST-Parser/Sphinx integration: {issue} and {commit} are intentional source markup, and any GFM-limited output is pre-processed before reaching GitHub.

The rule was created for future reviews: https://app.greptile.com/review/custom-instructions?memory=f124b1c4-6ffb-4fb8-abf7-0d74fce56976

@greptile-apps

This comment has been minimized.

@tarasko
tarasko merged commit 5f4433f into aio-libs:master Sep 30, 2026
40 of 42 checks passed
@tarasko
tarasko deleted the towncrier branch September 30, 2026 09:46
Comment thread RELEASING.md
```console
$ python tools/changelog.py prepare 1.2.0
$ python -m pip install towncrier
$ python -m towncrier build --draft

@webknjaz webknjaz Sep 30, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarasko Pro tip: if you have uv, you can run some apps using commands like uvx towncrier and it'll take care about managing their installations for you. This way, you wouldn't even need that pip install. You can also use uv tool to manage isolated app installs.

@@ -1 +1 @@
86.contrib.md No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarasko looks like you copied this file? Or is it because you're on Windows? It was a symlink that Git preserves, I think. When Towncrier sees two identical files with two issue numbers, it shows them as one fragment but you can link it to two issues. But if it's under different categories, it'll show up twice, of course. Still, from the maintenance point of view, it's often easier to keep one text file and have additional symlinks with different numbers and categories, so that if you want to update it later, when preparing the release, you have to only update one file and not worry about forgetting to update all the files in a bunch that is meant to be byte-identical.


One other note — there's a special case in fragment naming: if you use a leading +, Towncrier will mark those fragments as "orphan" and won't link them to issues — you can use such notes for adding arbitrary entries.


I've also made an special template integration for having change notes pointing at commits but you didn't include it in this PR. If/when it's integrated, it'll be possible to make use of such fragment types as well.

@tarasko tarasko Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. I use linux, and it is not a symlink on my local clone. That's why I was confused.

towncrier build --draft
was producing

### Contributor-facing changes

- 86.contrib.md

  *PRs and issues:* {issue}`78`

- Added templates for issues and pull requests -- by {user}`Polandia94`.

  *PRs and issues:* {issue}`86`

I though it is just an incorrect news item that sneaked in.

I tried a clean clone of the repo and it is still not a symlink. But it works after I've fixed it locally to symlink. Nice feature of the towncrier :)


Do you mean a jinja template from pip-tools?
I originally included it, but then I was wondering what it does and if it is necessary at the first step at least given that aiofastnet doesn't have docs at this moment.

Anyway, I wanted to do it in 2 steps:

  1. Minimal towncrier integration with tooling that is necessary right now, so that we're able to release asap in case of serious issues with release notes already being built from towncrier news items.
  2. Expand, add MyST-parser integration for the Sphinx docs.

Am I right that you want to standardize approach to docs/release notes generation across the aio-libs and want to try it first with aiofastnet, right? That's perfectly fine, let's just do it in a separate PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though it is just an incorrect news item that sneaked in.

@tarasko you're right. It was missed during review.

It may be that @Polandia94 uses Windows then (it turns symlinks committed to Git into text files on checkout and requires hacks to create true symlinks on Git object level — I've done that in some of my automations so I know).
It's sometimes difficult to see these if something is a symlink or broken in GH PR review UI.

If you're okay with having Sphinx+RTD, there's an extension that I made for rendering Towncrier previews, which is particularly useful for PRs. But it effectively shows the entire render of all the fragments that are ready for the release, including what's being added in the PR.

Here's an example of an RTD PR preview build with that (and all the pieces I mentioned integrated together): https://pip-tools--2469.org.readthedocs.build/en/2469/changelog/#unreleased-changes

Am I right that you want to standardize approach to docs/release notes generation across the aio-libs and want to try it first with aiofastnet, right? That's perfectly fine, let's just do it in a separate PR.

Ack.

@@ -1 +1 @@
Added templates for issues and pull requests -- by {user}`Polandia94`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tarasko this syntax was coming from the future MyST-parser integration for the Sphinx docs. It's supposed to produce better links once integrated. GH or PyPI won't understand this which is a known and accepted trade-off. I thought you'd just use your script in the tools folder to mass-replace things after the towncrier run if you want something for GH representation but as a post-processing stage, so the original syntax is not lost.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's just do it in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants