Skip to content

Commit 3dc88eb

Browse files
seohyonkimZethson
andauthored
Add manual for using towncrier in CONTRIBUTING.md (#351)
* add manual for using towncrier in CONTRIBUTING.md * Add changelog fragment * changes after feedback * Update CONTRIBUTING.md Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net> --------- Co-authored-by: Lukas Heumos <lukas.heumos@posteo.net>
1 parent a2318ff commit 3dc88eb

File tree

5 files changed

+55
-3
lines changed

5 files changed

+55
-3
lines changed

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,57 @@ All chapters are available as Jupyter Notebooks and end-to-end executable.
7575
The diverse requirements of tools for the chapters do not allow it for us to provide a single environment that can build all chapters.
7676
Hence, we decided to provide minimal Conda environments per chapter. These can be found in the respective folders.
7777

78+
## Adding changelog entries with `towncrier`
79+
80+
We use `towncrier` to manage our changelog. Here’s how to include a changelog entry when making a PR:
81+
82+
1. Install `towncrier` (only once):
83+
84+
```bash
85+
pip install towncrier
86+
```
87+
88+
2. Make your pull request as usual.
89+
90+
3. After opening your PR, note the PR number (e.g., 34), and create a changelog fragment:
91+
92+
```bash
93+
towncrier create -c 'update blah blah ([#34](https://github.com/theislab/single-cell-best-practices/pull/34)) <sub>@seohyonkim</sub>' 34.changed.md
94+
```
95+
96+
Replace "update blah blah" with a brief description of your change, PR number with your PR number, and the author of the PR with your github tag.
97+
Valid categories for the filename of the `markdown` are:
98+
99+
`added`
100+
`changed`
101+
`fixed`
102+
`removed`
103+
104+
4. This will create a `.md` file (e.g., `34.changed.md`) in the `changelog.d/` directory (at the root of the repo). Make sure this file is included in your commit.
105+
106+
5. Push your changes again.
107+
108+
### Releasing a new version (maintainers only)
109+
110+
To release a new version:
111+
112+
1. Run Towncrier to build the changelog:
113+
114+
```bash
115+
towncrier build --yes --version 2.0.0
116+
```
117+
118+
This will update `CHANGELOG.md` and remove the `changelog.d/` directory.
119+
120+
2. Add contributor names and links to the PR manually under each relevant PR entry in the generated `CHANGELOG.md`.
121+
122+
3. Recreate the `changelog.d/` directory for future PRs:
123+
124+
```bash
125+
mkdir changelog.d
126+
touch changelog.d/.gitkeep
127+
```
128+
78129
## Environment setup
79130

80131
Run the following command with the environment file of choice to create the environment for the chapter that you want to build.

changelog.d/345.added.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add new feature `changelog`. Changelog fragments will be added in `changelog` chapter.
1+
Add new feature `changelog`. Changelog fragments will be added in `changelog` chapter. ([#345](https://github.com/theislab/single-cell-best-practices/pull/345)) <sub>@seohyonkim</sub>

changelog.d/347.changed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add dataset generator and updatae texts in `Interoperability` chapter
1+
Add dataset generator and updatae texts in `Interoperability` chapter. ([#347](https://github.com/theislab/single-cell-best-practices/pull/347)) <sub>@seohyonkim</sub>

changelog.d/348.added.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add env- and lamin-setup dropdown with `make dropdown`
1+
Add env- and lamin-setup dropdown with `make dropdown`. ([#348](https://github.com/theislab/single-cell-best-practices/pull/348)) <sub>@LuisHenzlmeier</sub>

changelog.d/351.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add manual to use `towncrier` in `CONTRIBUTING.md`. ([#351](https://github.com/theislab/single-cell-best-practices/pull/351)) <sub>@seohyonkim</sub>

0 commit comments

Comments
 (0)