Repository navigation
Automate our changelog generation - #885
Brett Cannon (brettcannon) merged 16 commits into
Conversation
Codecov Report
@@ Coverage Diff @@
## master #885 +/- ##
==========================================
+ Coverage 64.08% 64.62% +0.54%
==========================================
Files 257 259 +2
Lines 11855 11980 +125
Branches 2110 2128 +18
==========================================
+ Hits 7597 7742 +145
+ Misses 4249 4229 -20
Partials 9 9
Continue to review full report at Codecov.
|
Eric Snow (ericsnowcurrently)
left a comment
There was a problem hiding this comment.
LGTM
I left a few minor comments that I do not consider blockers.
| entry = path.read_text("utf-8") | ||
| if cleanup: | ||
| git_rm(path) | ||
| # I want dataclasses! |
There was a problem hiding this comment.
In the meantime namedtuple would probably still have a similar benefit:
class Entry(namedtuple('Entry', 'issue text')):
...
class Section(nametuple('Section', 'order name entries')):
...
There was a problem hiding this comment.
Nope, uh-huh, ain't going to do it. I can use types.SimpleNamespace until then. 😄
|
|
||
|
|
||
| class RunType(enum.Enum): | ||
|
|
| for path in directory.iterdir(): | ||
| if not path.is_dir(): | ||
| continue | ||
| if ' ' not in path.name: |
There was a problem hiding this comment.
or check sep 2 lines down...
| issue = int(match.group('issue')) | ||
| entry = path.read_text("utf-8") | ||
| if cleanup: | ||
| git_rm(path) |
There was a problem hiding this comment.
Something feels off about doing this here as a side-effect of new_entries(). It's fine, but still feels out of place.
There was a problem hiding this comment.
I guess I could walk the file system twice by having a custom walking generator which could be called both for getting the news entries and then called a second time to call git-rm on the path?
This introduces a file-based format for changelog entries to progressively build up news entries rather than doing it at once just before release.
The
announcescript tries to balance any repetitive behaviours with not automating everything at the price of complicated configuration. It also isn't written to be generically suitable for other projects. The key reason for doing our own solution is (1) the npm-based ones all wanted to use git commit messages which are immutable, and (2) the file-based ones out of the Python community are all reST-based.