Skip to content

Commit

Permalink
chore: set up towncrier for changelog management
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
  • Loading branch information
SdgJlbl committed Mar 22, 2024
1 parent 9985af7 commit 9241ae7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

<!-- towncrier release notes start -->

## [0.44.0](https://github.com/Substra/substra-backend/releases/tag/0.44.0) 2024-03-07

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,22 @@ Install [pre-commit](https://pre-commit.com/), then run:
pre-commit install
```

## How to generate the changelog

The changelog is managed with [towncrier](https://towncrier.readthedocs.io/en/stable/index.html).
To add a new entry in the changelog, add a file in the `changes` folder. The file name should have the following structure:
`<unique_id>.<change_type>`.
The `unique_id` is a unique identifier, we currently use the PR number.
The `change_type` can be of the following types: `added`, `changed`, `removed`, `fixed`.

To generate the changelog (for example during a release), use the following command (you must have the dev dependencies installed):

```
towncrier build --version=<x.y.z>
```

You can use the `--draft` option to see what would be generated without actually writing to the changelog (and without removing the fragments).

## Companion repositories

The Substra platform is built from several components (see the [architecture](https://doc.substra.ai/architecture.html) documentation for a comprehensive overview):
Expand Down
3 changes: 2 additions & 1 deletion backend/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ djangorestframework-stubs==1.8.0
django-stubs==1.14.0
celery-types==0.22.0
docker==6.1.3
celery[pytest]
celery[pytest]
towncrier==23.11.0
1 change: 1 addition & 0 deletions changes/861.changed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [chore] `towncrier` is now used for changelog management ([#861](https://github.com/Substra/substra-backend/pull/861))
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,15 @@ exclude = [

[tool.django-stubs]
django_settings_module = "backend.settings.test"


[tool.towncrier]
directory = "changes"
filename = "CHANGELOG.md"
start_string = "<!-- towncrier release notes start -->\n"
underlines = ["", "", ""]
title_format = "## [{version}](https://github.com/Substra/substra-backend/releases/tag/{version}) - {project_date}"
[tool.towncrier.fragment.added]
[tool.towncrier.fragment.removed]
[tool.towncrier.fragment.changed]
[tool.towncrier.fragment.fixed]

0 comments on commit 9241ae7

Please sign in to comment.