Skip to content

Commit a5ad458

Browse files
committed
Merge remote-tracking branch 'origin/main' into 457-optional-precommit
2 parents 9e21315 + e2b6ce6 commit a5ad458

9 files changed

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
name: markdown-link-check
1+
name: link-check
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
78
pull_request:
89
branches:
910
- main
1011
schedule:
11-
- cron: '0 0 * * 0' # every Sunday at 00:00
12+
- cron: '0 0 1 * *' # first day of every month at midnight
13+
14+
permissions:
15+
contents: read
16+
issues: write
1217

1318
jobs:
1419
linkChecker:
@@ -19,15 +24,15 @@ jobs:
1924
- name: Link Checker
2025
id: lychee
2126
uses: lycheeverse/lychee-action@v1
22-
with:
23-
# fail action if there are broken links
24-
fail: true
27+
28+
- name: Set Issue Title
29+
id: set_title
30+
run: echo "ISSUE_TITLE=Link Checker Report - $(date '+%Y-%m-%d')" >> $GITHUB_ENV
2531

2632
- name: Create Issue From File
27-
# create issues only when triggered by schedule
28-
if: github.event_name == 'schedule' && env.lychee_exit_code != 0
33+
if: env.lychee_exit_code != 0
2934
uses: peter-evans/create-issue-from-file@v5
3035
with:
31-
title: Link Checker Report
36+
title: ${{ env.ISSUE_TITLE }}
3237
content-filepath: ./lychee/out.md
3338
labels: report, automated issue

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
### Changed
1616

1717
* pre-commit script is optional ([#457](https://github.com/NLeSC/python-template/issues/457))
18+
* CHANGELOG.md is now optional ([#462](https://github.com/NLeSC/python-template/issues/462))
1819
* Moved to src/ based layout for generated packages
1920
* Moved from setup.cfg/.py to pyproject.toml [#351](https://github.com/NLeSC/python-template/issues/351)
2021
* 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ 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
@@ -98,7 +104,6 @@ AddPreCommit:
98104
# internal fields
99105
_subdirectory: template
100106

101-
102107
# user messages
103108
_message_before_copy: |
104109
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
@@ -135,10 +135,12 @@ This section describes how to make a release in 3 parts:
135135

136136
### (1/3) Preparation
137137

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

143145
### (2/3) PyPI
144146

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"]

template/CHANGELOG.md renamed to template/{% if AddChangeLog %}CHANGELOG.md{% endif %}

File renamed without changes.

0 commit comments

Comments
 (0)