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

Lines changed: 62 additions & 31 deletions

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/next_steps/02_citation.md.jinja renamed to template/.github/next_steps/{% if AddCitation %}02_citation.md{% endif %}.jinja

File renamed without changes.

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'

template/.github/workflows/cffconvert.yml renamed to template/.github/workflows/{% if AddCitation %}cffconvert.yml{% endif %}

File renamed without changes.
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 'nlesc-python-template@users.noreply.github.com'
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.

0 commit comments

Comments
 (0)