Skip to content

Commit aa7326f

Browse files
authored
Merge pull request #471 from NLeSC/458_citation
458-Add question for citation files
2 parents 3ed9c6f + a0d7b16 commit aa7326f

16 files changed

+62
-31
lines changed

CHANGELOG.md

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

55
### Added
66

7+
* Make citation optional [#471](https://github.com/NLeSC/python-template/pull/471)
78
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
89
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)
910
* Template unit tests for documentation generation, linting and version bumping

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Use this [Copier](https://copier.readthedocs.io) template to generate an empty P
1919
- [Contributing guidelines](template/CONTRIBUTING.md.jinja),
2020
- Continuous code quality and code coverage reporting using [Sonarcloud](https://sonarcloud.io/),
2121
- Automatic creation of [issues](template/.github/next_steps) with instructions how to pass all GitHub action workflows and integrate with services like Zenodo and Read the Docs,
22-
- Instructions how to make package [citable](template/.github/next_steps/02_citation.md.jinja)
22+
- Instructions how to make package [citable](.github/next_steps/%7B%25%20if%20AddCitation%20%25%7D02_citation.md%7B%25%20endif%20%25%7D.jinja)
2323
- FAIR software recommendation badge,
2424
- Optional [pre commit hook](template/README.dev.md.jinja#running-linters-locally) to catch lint errors early
2525

copier.yml

Lines changed: 6 additions & 0 deletions
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+
AddCitation:
87+
when: "{{ template_profile == 'ask' }}"
88+
type: bool
89+
default: "{{ template_profile != 'minimum' }}"
90+
help: Citation file and cffconvert workflow which validates the citation file
91+
8692
AddChangeLog:
8793
when: "{{ template_profile == 'ask' }}"
8894
type: bool

profiles.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
- package_name:
33
- version:
44
- template_profile:
5-
- minumum --> DONE
6-
- recommeded --> all questions - excluded with the defaults
5+
- minumum --> DONE
6+
- recommeded --> all questions - excluded with the defaults
77
- optional --> all questions with answers off
88

99
- github_organization:
1010
- full_name:
1111
- email:
1212
- copyright_holder:
1313
- licence (exist)
14-
14+
1515
- community:
1616
- code of conduct --> if TRUE ask for email
1717
- contributing guidelines
@@ -20,7 +20,7 @@
2020
- developer documentation
2121
- online documentation (read the docs)
2222
- project_setup.md
23-
23+
2424
- code quality:
2525
- sonarcloud
2626
- ruff and lint workflow
@@ -30,7 +30,7 @@
3030

3131
- publishing and release
3232
- zenodo
33-
- keywords
33+
- keywords
3434
- changelog.md
3535
- cffconvert workflow and citation file
3636

template/.github/workflows/next_steps.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,30 @@ jobs:
1111
- name: Create Sonarcloud integration issue
1212
uses: JasonEtco/create-an-issue@v2
1313
env:
14-
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515
with:
1616
filename: .github/next_steps/01_sonarcloud_integration.md
1717
id: sonarcloud
18-
19-
- name: Create citation data issue
20-
uses: JasonEtco/create-an-issue@v2
21-
env:
22-
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
23-
with:
24-
filename: .github/next_steps/02_citation.md
25-
id: citation
2618
- name: Create Zenodo integration issue
2719
uses: JasonEtco/create-an-issue@v2
2820
env:
29-
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3022
with:
3123
filename: .github/next_steps/04_zenodo_integration.md
3224
id: zenodo
3325
- name: Create linting issue
3426
uses: JasonEtco/create-an-issue@v2
3527
env:
36-
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3729
with:
3830
filename: .github/next_steps/05_linting.md
3931
id: linting
4032
- name: List created issues
4133
run: |
4234
echo 'Created issues that must be completed to have fully working Python package:
43-
* Sonarcloud integration ${{ '{{ ' -}} steps.sonarcloud.outputs.url }}
44-
* Zenodo integration ${{ '{{ ' -}} steps.zenodo.outputs.url }}
45-
* Citation data ${{ '{{ ' -}} steps.citation.outputs.url }}
46-
* Linting fixes ${{ '{{ ' -}} steps.linting.outputs.url }}'
35+
* Sonarcloud integration ${{ steps.sonarcloud.outputs.url }}
36+
* Zenodo integration ${{ steps.zenodo.outputs.url }}
37+
* Linting fixes ${{ steps.linting.outputs.url }}'
4738
- name: Cleanup files needed to create next steps issues
4839
run: |
4940
git config --global user.name 'NLeSC Python template'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on: [push]
2+
permissions:
3+
contents: write
4+
issues: write
5+
name: Create an issue for citation
6+
jobs:
7+
next_steps:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Create citation data issue
12+
uses: JasonEtco/create-an-issue@v2
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
with:
16+
filename: .github/next_steps/02_citation.md
17+
id: citation
18+
- name: List created issues
19+
run: |
20+
echo 'Created issues that must be completed to have fully working Python package:
21+
* Citation data ${{ steps.citation.outputs.url }}'
22+
- name: Cleanup files needed to create next steps issues
23+
run: |
24+
git config --global user.name 'NLeSC Python template'
25+
git config --global user.email '[email protected]'
26+
git rm .github/workflows/next_steps_citation.yml
27+
git rm -r .github/next_steps
28+
git commit -am "Cleanup automated next steps issue generator"
29+
git push

template/CONTRIBUTING.md.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ In case you feel like you've made a valuable contribution, but you don't know ho
4747

4848
To create a release you need write permission on the repository.
4949

50-
1. Check the author list in [`CITATION.cff`](CITATION.cff)
51-
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).
50+
{% if AddCitation -%}1. Check the author list in [`CITATION.cff`](CITATION.cff){%- endif %}
51+
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, {% if AddCitation %}CITATION.cff{%- endif -%} and docs/conf.py (and other places it was possibly added).
5252
{% if AddChangeLog -%}
5353
1. Update the `CHANGELOG.md` to include changes made
5454
{%- endif %}

template/MANIFEST.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

template/MANIFEST.in.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{% if AddCitation -%}include CITATION.cff{%- endif %}
2+
include LICENSE
3+
include NOTICE
4+
include README.md

template/README.dev.md.jinja

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

134134
### (1/3) Preparation
135135

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

template/README.md.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
{%- endif -%}
1919
| **GitHub Actions** | &nbsp; |
2020
| Build | [![build]({{repository_url}}/actions/workflows/build.yml/badge.svg)]({{repository_url}}/actions/workflows/build.yml) |
21+
{% if AddCitation -%}
2122
| Citation data consistency | [![cffconvert]({{repository_url}}/actions/workflows/cffconvert.yml/badge.svg)]({{repository_url}}/actions/workflows/cffconvert.yml) |
23+
{%- endif -%}
2224
| SonarCloud | [![sonarcloud]({{repository_url}}/actions/workflows/sonarcloud.yml/badge.svg)]({{repository_url}}/actions/workflows/sonarcloud.yml) |
2325
| MarkDown link checker | [![markdown-link-check]({{repository_url}}/actions/workflows/markdown-link-check.yml/badge.svg)]({{repository_url}}/actions/workflows/markdown-link-check.yml) |
2426

template/project_setup.md.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ help you decide which tool to use for packaging.
9292
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/releases?id=changelogmd)
9393
{%- endif %}
9494

95+
{% if AddCitation -%}
9596
## CITATION.cff
9697

9798
- To allow others to cite your software, add a `CITATION.cff` file
9899
- It only makes sense to do this once there is something to cite (e.g., a software release with a DOI).
99100
- Follow the [making software citable](https://guide.esciencecenter.nl/#/citable_software/making_software_citable) section in the guide.
101+
{%- endif -%}
100102

101103
## CODE_OF_CONDUCT.md
102104

template/pyproject.toml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ filename = "src/{{ package_name }}/__init__.py"
151151
[[tool.bumpversion.files]]
152152
filename = "pyproject.toml"
153153

154+
{% if AddCitation -%}
154155
[[tool.bumpversion.files]]
155156
filename = "CITATION.cff"
157+
{%- endif %}
156158

157159
[[tool.bumpversion.files]]
158160
filename = "docs/conf.py"

0 commit comments

Comments
 (0)