Skip to content

Commit

Permalink
Merge pull request #480 from NLeSC/462-optional-changelog
Browse files Browse the repository at this point in the history
Make changelog optional
  • Loading branch information
sverhoeven authored Aug 21, 2024
2 parents 4ed8776 + 5c83d4a commit e2b6ce6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

### Changed

* CHANGELOG.md is now optional ([#462](/~https://github.com/NLeSC/python-template/issues/462))
* Moved to src/ based layout for generated packages
* Moved from setup.cfg/.py to pyproject.toml [#351](/~https://github.com/NLeSC/python-template/issues/351)
* Moved from prospector to ruff [#336](/~https://github.com/NLeSC/python-template/issues/336)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use this [Copier](https://copier.readthedocs.io) template to generate an empty P
- [README.md](template/README.md.jinja) for package users,
- [README.dev.md](template/README.dev.md.jinja) for package developer,
- [project_setup.md](template/project_setup.md.jinja) with extensive documentation about project setup,
- [Change log](template/CHANGELOG.md),
- [Change log](template/%7B%25%20if%20AddChangeLog%20%25%7DCHANGELOG.md%7B%25%20endif%20%25%7D),
- [Code of Conduct](template/CODE_OF_CONDUCT.md.jinja),
- [Contributing guidelines](template/CONTRIBUTING.md.jinja),
- Continuous code quality and code coverage reporting using [Sonarcloud](https://sonarcloud.io/),
Expand Down
8 changes: 6 additions & 2 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,21 @@ AddGitHubActions:
default: "{{ template_profile != 'minimum' }}"
help: GitHub actions to test the package and the documentation

AddChangeLog:
when: "{{ template_profile == 'ask' }}"
type: bool
default: "{{ template_profile != 'minimum' }}"
help: Add a change log to keep track of changes in the package

AddOnlineDocumentation:
when: "{{ template_profile == 'ask' }}"
type: bool
default: "{{ template_profile != 'minimum' }}"
help: Online documentation using Read the Docs


# internal fields
_subdirectory: template


# user messages
_message_before_copy: |
Thanks for generating a project using our template.
Expand Down
4 changes: 4 additions & 0 deletions template/CONTRIBUTING.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ The sections below outline the steps in each case.
1. make sure the existing tests still work by running ``pytest``;
1. add your own tests (if necessary);
1. update or expand the documentation;
{% if AddChangeLog -%}
1. update the `CHANGELOG.md` file with your change;
{%- endif %}
1. [push](http://rogerdudler.github.io/git-guide/) your feature branch to (your fork of) the {{ package_name }} repository on GitHub;
1. create the pull request, e.g. following the instructions [here](https://help.github.com/articles/creating-a-pull-request/).

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

1. Check the author list in [`CITATION.cff`](CITATION.cff)
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).
{% if AddChangeLog -%}
1. Update the `CHANGELOG.md` to include changes made
{%- endif %}
1. Go to the [GitHub release page]({{ repository_url }}/releases)
1. Press draft a new release button
1. Fill version, title and description field
Expand Down
8 changes: 5 additions & 3 deletions template/README.dev.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ This section describes how to make a release in 3 parts:

### (1/3) Preparation

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

### (2/3) PyPI

Expand Down
2 changes: 2 additions & 0 deletions template/project_setup.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ help you decide which tool to use for packaging.
- The project is set up with a logging example.
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=logging)

{% if AddChangeLog -%}
## CHANGELOG.md

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

## CITATION.cff

Expand Down
2 changes: 2 additions & 0 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ publishing = [
[project.urls]
Repository = "{{ repository_url }}"
Issues = "{{ repository_url }}/issues"
{% if AddChangeLog -%}
Changelog = "{{ repository_url }}/CHANGELOG.md"
{%- endif %}

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
File renamed without changes.

0 comments on commit e2b6ce6

Please sign in to comment.