Skip to content

Commit e2b6ce6

Browse files
authored
Merge pull request #480 from NLeSC/462-optional-changelog
Make changelog optional
2 parents 4ed8776 + 5c83d4a commit e2b6ce6

8 files changed

+21
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
### Changed
1616

17+
* CHANGELOG.md is now optional ([#462](https://github.com/NLeSC/python-template/issues/462))
1718
* Moved to src/ based layout for generated packages
1819
* Moved from setup.cfg/.py to pyproject.toml [#351](https://github.com/NLeSC/python-template/issues/351)
1920
* Moved from prospector to ruff [#336](https://github.com/NLeSC/python-template/issues/336)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Use this [Copier](https://copier.readthedocs.io) template to generate an empty P
1414
- [README.md](template/README.md.jinja) for package users,
1515
- [README.dev.md](template/README.dev.md.jinja) for package developer,
1616
- [project_setup.md](template/project_setup.md.jinja) with extensive documentation about project setup,
17-
- [Change log](template/CHANGELOG.md),
17+
- [Change log](template/%7B%25%20if%20AddChangeLog%20%25%7DCHANGELOG.md%7B%25%20endif%20%25%7D),
1818
- [Code of Conduct](template/CODE_OF_CONDUCT.md.jinja),
1919
- [Contributing guidelines](template/CONTRIBUTING.md.jinja),
2020
- Continuous code quality and code coverage reporting using [Sonarcloud](https://sonarcloud.io/),

copier.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,21 @@ AddGitHubActions:
8383
default: "{{ template_profile != 'minimum' }}"
8484
help: GitHub actions to test the package and the documentation
8585

86+
AddChangeLog:
87+
when: "{{ template_profile == 'ask' }}"
88+
type: bool
89+
default: "{{ template_profile != 'minimum' }}"
90+
help: Add a change log to keep track of changes in the package
91+
8692
AddOnlineDocumentation:
8793
when: "{{ template_profile == 'ask' }}"
8894
type: bool
8995
default: "{{ template_profile != 'minimum' }}"
9096
help: Online documentation using Read the Docs
9197

92-
9398
# internal fields
9499
_subdirectory: template
95100

96-
97101
# user messages
98102
_message_before_copy: |
99103
Thanks for generating a project using our template.

template/CONTRIBUTING.md.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ The sections below outline the steps in each case.
3535
1. make sure the existing tests still work by running ``pytest``;
3636
1. add your own tests (if necessary);
3737
1. update or expand the documentation;
38+
{% if AddChangeLog -%}
3839
1. update the `CHANGELOG.md` file with your change;
40+
{%- endif %}
3941
1. [push](http://rogerdudler.github.io/git-guide/) your feature branch to (your fork of) the {{ package_name }} repository on GitHub;
4042
1. create the pull request, e.g. following the instructions [here](https://help.github.com/articles/creating-a-pull-request/).
4143

@@ -47,7 +49,9 @@ To create a release you need write permission on the repository.
4749

4850
1. Check the author list in [`CITATION.cff`](CITATION.cff)
4951
1. Bump the version using `bump-my-version bump <major|minor|patch>`. For example, `bump-my-version bump major` will increase major version numbers everywhere it's needed (code, meta, etc.) in the repo. Alternatively the version can be manually changed in {{ package_name }}/__init__.py, pyproject.toml, CITATION.cff and docs/conf.py (and other places it was possibly added).
52+
{% if AddChangeLog -%}
5053
1. Update the `CHANGELOG.md` to include changes made
54+
{%- endif %}
5155
1. Go to the [GitHub release page]({{ repository_url }}/releases)
5256
1. Press draft a new release button
5357
1. Fill version, title and description field

template/README.dev.md.jinja

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ This section describes how to make a release in 3 parts:
133133

134134
### (1/3) Preparation
135135

136+
{% if AddChangeLog -%}
136137
1. Update the <CHANGELOG.md> (don't forget to update links at bottom of page)
137-
2. Verify that the information in [`CITATION.cff`](CITATION.cff) is correct.
138-
3. Make sure the [version has been updated](#versioning).
139-
4. Run the unit tests with `pytest -v`
138+
{%- endif %}
139+
1. Verify that the information in [`CITATION.cff`](CITATION.cff) is correct.
140+
1. Make sure the [version has been updated](#versioning).
141+
1. Run the unit tests with `pytest -v`
140142

141143
### (2/3) PyPI
142144

template/project_setup.md.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ help you decide which tool to use for packaging.
8585
- The project is set up with a logging example.
8686
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=logging)
8787

88+
{% if AddChangeLog -%}
8889
## CHANGELOG.md
8990

9091
- Document changes to your software package
9192
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/releases?id=changelogmd)
93+
{%- endif %}
9294

9395
## CITATION.cff
9496

template/pyproject.toml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ publishing = [
7171
[project.urls]
7272
Repository = "{{ repository_url }}"
7373
Issues = "{{ repository_url }}/issues"
74+
{% if AddChangeLog -%}
7475
Changelog = "{{ repository_url }}/CHANGELOG.md"
76+
{%- endif %}
7577

7678
[tool.pytest.ini_options]
7779
testpaths = ["tests"]

0 commit comments

Comments
 (0)