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

Make it easier to check the formatting of a newsfragment locally #3084

Open
jakkdl opened this issue Sep 10, 2024 · 2 comments · Fixed by #3086
Open

Make it easier to check the formatting of a newsfragment locally #3084

jakkdl opened this issue Sep 10, 2024 · 2 comments · Fixed by #3086

Comments

@jakkdl
Copy link
Member

jakkdl commented Sep 10, 2024

Currently if you want to check the validity of any newsfragment locally you need to do something like

export READTHEDOCS=1
cd docs
make html

but then towncrier will attempt to remove your newsfragments as well as update changelog.rst, which means you need to afterwards restore/unstage the changes to those files.

It would be great to have an invocation of a shell script/tox/hatch/make target/etc that checked the formatting of the fragments without messing up local files.

@TeamSpen210
Copy link
Contributor

Hmm, currently towncrier only runs if READTHEDOCS is set. What we could do instead is use --keep so it doesn't remove the newsfragments - we only really want that when committing a release. Have the sphinx conf.py first read in the changelog file, run towncrier, then revert the file after the build finished.

@jakkdl
Copy link
Member Author

jakkdl commented Sep 19, 2024

Reopening in case we want to change the implementation, see discussion in the linked PR.

@jakkdl jakkdl reopened this Sep 19, 2024
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 a pull request may close this issue.

2 participants