11# changelist
22
3- Prepare an automatic changelog from GitHub pull requests. For example, see
3+ Changelist helps you write better release notes by automating as much of the
4+ process as possible. For example, see
45https://github.com/scientific-python/changelist/blob/main/CHANGELOG.md .
56
7+ ** Features**
8+
9+ - Compile a list of pull requests, code authors and reviewers between any two
10+ valid Git objects (refs).
11+ - Categorize pull requests into sections based on GitHub labels.
12+ - Point it at any repository on GitHub. No need to clone or checkout a
13+ repository locally, a Python package is all that's needed.
14+
15+ We recommend to treat the generated document as a first draft to build
16+ on and not as an already perfect documentation of the release.
17+
618_ This project is currently in its alpha stage and might be incomplete or change a lot!_
719
820## Installation
@@ -11,26 +23,101 @@ _This project is currently in its alpha stage and might be incomplete or change
1123pip install changelist
1224```
1325
14- ## Set up your repository
26+ ## Usage
27+
28+ The script requires a [ GitHub personal access
29+ token] ( https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens ) .
30+ The token does not need any permissions, since it is used only to
31+ increase query limits.
32+
33+ ``` sh
34+ export GH_TOKEN=' ...'
35+ changelist scientific-python/changelist v0.2.0 main
36+ ```
1537
16- To categorize merged PRs in the changelist, each PR
17- must have have one of the following labels:
38+ This will list all pull requests, authors and reviewers that touched commits
39+ between ` v0.2.0 ` and ` main ` (excluding ` v0.2.0 ` ).
40+ Pull requests are sorted into section according to the configuration in
41+ ` tool.changelist.label_section_map ` .
42+
43+ ## Configuration
44+
45+ changelist can be configured from two sources, in order of precedence:
46+
47+ - A local TOML file specified with the ` --config ` option
48+ - A remote ` pyproject.toml ` at ` stop_rev `
49+
50+ If a configuration option is not specified in either file above, changelist
51+ falls back to the following configuration:
52+
53+ ```` toml
54+ # Default changelist configuration as supported in pyproject.toml
55+ [tool .changelist ]
56+
57+ # A template string that is included as the title of the generated notes.
58+ # "{repo_name}" and "{version}", if given, are replaced by the respective
59+ # values given in the command line.
60+ title_template = " {repo_name} {version}"
61+
62+ # A template string that is included as introductory text after the title.
63+ # "{repo_name}" and "{version}", if given, are replaced by the respective
64+ # values given in the command line.
65+ intro_template = """
66+ We're happy to announce the release of {repo_name} {version}!
67+ """
68+
69+ # A template string that is included at the end of the generated notes.
70+ # "{repo_name}" and "{version}", if given, are replaced by the respective
71+ # values given in the command line.
72+ outro_template = """
73+ _These lists are automatically generated, and may not be complete or may contain
74+ duplicates._
75+ """
76+
77+ # Profiles that are excluded from the contributor list.
78+ ignored_user_logins = [
79+ " web-flow" ,
80+ ]
81+
82+ # If this regex matches a pull requests description, the captured content
83+ # is included instead of the pull request title.
84+ # E.g. the default regex below is matched by
85+ #
86+ # ```release-note
87+ # An ideally expressive description of the change that is included as a single
88+ # bullet point. Newlines are removed.
89+ # ```
90+ #
91+ # If you modify this regex, make sure to match the content with a capture
92+ # group named "summary".
93+ pr_summary_regex = " ^```release-note\\ s*(?P<summary>[\\ s\\ S]*?\\ w[\\ s\\ S]*?)\\ s*^```"
94+
95+ # If any of a pull request's labels matches one of the regexes on the left side
96+ # its summary will appear in the appropriate section with the title given on
97+ # the right side. If a pull request doesn't match one of these categories it is
98+ # sorted into a section titled "Other". Pull request can appear in multiple
99+ # sections as long as their labels match.
100+ [tool .changelist .label_section_map ]
101+ ".*Highlight.*" = " Highlights"
102+ ".*New feature.*" = " New Features"
103+ ".*API.*" = " API Changes"
104+ ".*Enhancement.*" = " Enhancements"
105+ ".*Performance.*" = " Performance"
106+ ".*Bug fix.*" = " Bug Fixes"
107+ ".*Documentation.*" = " Documentation"
108+ ".*Infrastructure.*" = " Infrastructure"
109+ ".*Maintenance.*" = " Maintenance"
110+ ````
18111
19- - ` type: Highlights `
20- - ` type: New features `
21- - ` type: Enhancements `
22- - ` type: Performance `
23- - ` type: Bug fix `
24- - ` type: API `
25- - ` type: Maintenance `
26- - ` type: Documentation `
27- - ` type: Infrastructure `
112+ ## Set up your repository
28113
29- This list will soon be configurable.
114+ To categorize merged PRs in the changelist with the default configuration, each
115+ PR must have a label that matches one of the regexes on the left side of the
116+ ` label_section_map ` table, e.g. ` type: Highlights ` .
30117
31118### Label checking
32119
33- To ensure that each PR has an associated ` type: ` label,
120+ You may want to ensure that each PR has an associated ` type: ` label,
34121we recommend adding an action that fails CI if the label is missing.
35122
36123To do so, place the following in ` .github/workflows/label-check.yaml ` :
@@ -89,15 +176,3 @@ jobs:
89176` ` `
90177
91178See https://github.com/scientific-python/attach-next-milestone-action for more information.
92-
93- # # Usage
94-
95- ` ` ` sh
96- export GH_TOKEN='...'
97- changelist scikit-image/scikit-image v0.21.0 main
98- ` ` `
99-
100- The script requires a [GitHub personal access
101- token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
102- The token does not need any permissions, since it is used only to
103- increase query limits.
0 commit comments