Fix for removed top_line
argument in towncrier renderer
#14
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.
Towncrier 22.8.0 changed the arguments which are passed to
towncrier._builder.render_fragments
in twisted/towncrier#303. This is a breaking change for users of this sphinx plugin as thetop_line
variable is no longer supported in custom templates, as towncrier no longer passes it into the Jinja renderer. This should not be a breaking change for packages which are using the default template.The changes made in this PR are to let the template craft the top line itself from the package name, version number and date. However, if a custom
title_format
is configured for towncrier, this plugin will craft the top line and prepend it to the rendered changelog.I've set the minimum Towncrier version to
22.8.0
(released yesterday) so the newtowncrier._builder.render_fragments
signature is used. If this is too big a jump, we could check the town crier version in the plugin code and support both.This should probably be tested on sunpy and astropy before releasing.