Skip to content

Add towncrier for updating the news#555

Closed
dwalkerbeta wants to merge 0 commit into
pypa:masterfrom
dwalkerbeta:master
Closed

Add towncrier for updating the news#555
dwalkerbeta wants to merge 0 commit into
pypa:masterfrom
dwalkerbeta:master

Conversation

@dwalkerbeta
Copy link
Copy Markdown
Contributor

@dwalkerbeta dwalkerbeta commented Sep 16, 2018

Towncrier looks for a directory called "newsfragments" and uses the filenames/contents to generate a news.rst file, as requested via issue #474. News fragments should be named number.type where number is the pull request number and type is a type specified in the pyproject.toml. The most used type will probably be .update since that encompasses any page updates.

When running towncrier you must specify a version and date (it will look for a __version__, but there is none), and the date will end up being the title of the section, so I used --date="Month Year". While version must be specified it is never used, and so honestly you could just say --version=1 and your news will be generated all the same. If you want to see a draft without it writing to file, just include --draft.

Anything in the newsfragments directory gets deleted via git rm when you run towncrier, so make sure to add the fragments to git or you will have to manually delete them.

Let me know if you'd like to see any changes with this PR.

Copy link
Copy Markdown
Member

@pradyunsg pradyunsg left a comment

Choose a reason for hiding this comment

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

I'd prefer we call out new pages first, then updates and then removals.

More comments inline (reviewed on mobile, apologies for the terseness)

Comment thread pyproject.toml Outdated
showcontent = true

[[tool.towncrier.type]]
directory = "doc"
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.

This seems unnecessary. The entire project is documentation. :)

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, I can remove this type.

Comment thread pyproject.toml Outdated
underlines = ["-", "~"]

[[tool.towncrier.type]]
directory = "bugfix"
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.

Perhaps this should instead be "Corrections" (or similar) instead?

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.

Is this made redundant by page updates?

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.

This is more for bugfixes on the backend side, not page updates.

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.

In that case this doesn't need to be called out on top and the current title/extension (gosh, towncrier needs more consistent naming) does not convey the same intent IMO.

Comment thread source/newsfragments/551.update Outdated
@@ -0,0 +1 @@
Move note on PATH to --user installs section. 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.

I'd suggest adding a ".rst" to the filename, so that text editors handle the format correctly and it provides a hint of what the format is to people who write it in the future.

551.update.rst

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.

The only problem I have with that is towncrier looks at the file ending to name its subsections. I'll have to test out what adding .rst does to towncrier's interpretation.

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.

Adding .rst does not interfere, so I think this suggestion is a good one.

Comment thread source/newsfragments/.gitignore Outdated
Comment thread pyproject.toml Outdated
showcontent = true

[[tool.towncrier.type]]
directory = "development"
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.

What purpose would this serve?

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.

Do you mean why would viewers want to know about how we develop the project?

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.

Yep. I don't see why we'd call out internal changes out in a user-facing file.

@theacodes
Copy link
Copy Markdown
Member

This seems like a lot of overhead. What does this workflow look like for contributors?

@dwalkerbeta
Copy link
Copy Markdown
Contributor Author

They could take a peek at current pull requests for what their number would be and include a fragment named with that number, or not change anything about the workflow and somebody else curates it at the end of each month.

If the second way is closer to what you want, then I agree it's a lot of overhead just to use towncrier.

@pradyunsg
Copy link
Copy Markdown
Member

With pip's use, we have a CI-like check on PRs, that exempts certain PRs from needing to create NEWS files. It makes it easier to enforce it on the PRs and most contributors just handle it themselves (there's a documentation link explaining everything).

@pradyunsg
Copy link
Copy Markdown
Member

@theacodes
Copy link
Copy Markdown
Member

Hrm, I'm really hesitant to do this, then.

Perhaps we should consider a lighter approach where we get CI to make sure each PR touches news unless exempted?

@pradyunsg
Copy link
Copy Markdown
Member

Perhaps we should consider a lighter approach where we get CI to make sure each PR touches news unless exempted?

Hmm... That's exactly pip's approach.

Did I mess up in explaining it?

@pradyunsg
Copy link
Copy Markdown
Member

Oh, do you mean instead of it being a separate Heroku app for verifying the change?

@dwalkerbeta
Copy link
Copy Markdown
Contributor Author

I'm not sure why this got closed. Is it because I referenced it in another PR that got merged?

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