[ENH] Use and document towncrier for creating and maintaining changelogs #213
No reviewers
Labels
No labels
CRITICAL
Stale
WIP
bug
concept
coordinate
dataset
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
maintenance
maps
marker
mask
on hold
parcellation
preprocess
question
ready
storage
template-space
triage
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
juaml/junifer!213
Loading…
Reference in a new issue
No description provided.
Delete branch "update/towncrier"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds support for
towncrierto maintain changelogs.Codecov Report
100.00% <ø> (ø)93.32% <ø> (ø)Flags with carried forward coverage won't be shown. Click here to find out more.
We are missing some things:
make localshould build the docs, including the latest news fragments. This is also used in the pr-preview.towncriershould be a dependency fordocsmake htmlshould also build the latest docs, including the news fragment of the "main" branch.Solution 1) We can, of course, call
towncrier build --keepto updatewhats_new.rstbefore doing thelocalandhtml. However, this will modify thewhats_new.rstfile, and this file will be a modified one for git.Solution 2) We can have a
towncrier_dev.tomlthat instead writes todev_whats_new.rst, but then we need to deal with this file when it does not exist (e.g. on release)Solution 3) Before
make localandmake htmlwe create a copy ofwhats_new.rst. We then build the docs as in solution 1. After, we restore the original version ofwhats_new.rst.@synchon: what's your take on this one?
My take would be:
towncrierwith--yesand--keep(or not) so it runs without prompt and then build the docs. This would make awhats_new.rststaged for commit but we don't bother as long as it builds ok as it's preview.main): Although we update the changelog now, I'm not sure if it makes sense to update the changelog with every pre-release changes. So, I wouldn't make any changes towhats_new.rst.First reply:
make localmake htmlSo both of the issues will be solved if the Makefile accounts for this.
towncrierdoesn't need to be called so it wouldn't stage anything in git.devbranch which could in turn have awhat_new_dev.rstbut that's a different case.)Yes they need to do it. Otherwise it would not be the same doc as in the pr-preview / main branch. The dev should be able to build the same docs locally.
Pre-release docs (as well as pr-preview) should include the changes in the DEV version. like we have now:

The point is that the
whats_new_rstfile is only commited to git on the release process. But it needs to be modified for:make local,make html, which will affect PR-preview and pre-release docs repectively.In short, behaviour should not change with respect to what we have now. Only implementation.
In that case I would adapt your solutions like this:
towncrier_dev.tomlwith the difference being in `filename = "docs/whats_new_dev.rst"towncrier build --config towncrier_dev.toml --keepin Makefile beforesphinxand ask user to commit that as well.changelog.rstand includewhats_new.rstandwhats_new_dev.rstin there as two sections in it.Why
commit? There's nothing to commit. The ".dev" changes of the whats_new should be re-created every time without commit.This also does not work, as sphinx complains that
whats_new_dev.rstdoes not exist (on releases). If we add an empty file, then we are in the same issue as before (git changes).Solution:
make localandmake htmlshould:whats_new.rstto how it was before 1):git stash -- docs/whats_new.rstneeds this in the CI for docs and docs preview:
Otherwise it does not install the full package with history, but only the last commit.