Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for removed top_line argument in towncrier renderer #14

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

ConorMacBride
Copy link
Member

@ConorMacBride ConorMacBride commented Aug 30, 2022

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 the top_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 new towncrier._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.

@pllim
Copy link

pllim commented Aug 31, 2022

Thank you! Feel free to open an exploratory PR on astropy if you want.

Do you think pinning sphinx-changelog to this PR branch here in astropy would help test it in astropy without merging anything?

https://github.com/astropy/astropy/blob/d15a689108dc5467c6223792ed34ca3aa829048b/setup.cfg#L96

@ConorMacBride
Copy link
Member Author

This fix works for astropy: astropy/astropy#13590

Copy link

@pllim pllim left a comment

Choose a reason for hiding this comment

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

Green astropy RTD is good to me. Thanks for the quick fix!

Please merge and do a release soon. Thanks! 🙏

@Cadair
Copy link
Member

Cadair commented Aug 31, 2022

I am all for only supporting the latest towncrier release as we are relying on private API and we don't want to be dealing with that.

@Cadair Cadair merged commit bc25fc2 into OpenAstronomy:main Aug 31, 2022
@Cadair
Copy link
Member

Cadair commented Aug 31, 2022

Let's see if the autorelease stuff still works: https://github.com/OpenAstronomy/sphinx-changelog/releases/tag/v1.2.0

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.

3 participants