Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

458-Add question for citation files #471

Merged
merged 23 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f728bd2
update the file list in profiles.md
fdiblen Aug 20, 2024
9e2ea38
add citation question
fdiblen Aug 20, 2024
e4195c3
create CITATION.cff conditionally
fdiblen Aug 20, 2024
08e3d95
create cffconvert.yml workflow conditionally
fdiblen Aug 20, 2024
aaf7cc8
add a next steps workflow that creates an issue only about citation
fdiblen Aug 20, 2024
94640d6
remove citation job from the next steps workflow
fdiblen Aug 20, 2024
3d61285
fix the name of CITATION.cff file
fdiblen Aug 20, 2024
1fc88bc
update the changelog
fdiblen Aug 20, 2024
008596a
fix escape character issues in next_steps*.yml files
fdiblen Aug 20, 2024
b5c84a2
add missing single quote to citation workflow
fdiblen Aug 21, 2024
6415959
add missing single quote to citation workflow
fdiblen Aug 21, 2024
4070729
create .github/next_steps/02_citation.md conditionally
fdiblen Aug 21, 2024
0d96a24
include CITATION.cff in MANIFEST.in conditionally
fdiblen Aug 21, 2024
1fc3969
include CITATION.cff in bumversion conditionally
fdiblen Aug 21, 2024
3e9f2ca
show cffconvert badge conditionally
fdiblen Aug 21, 2024
1b68ffb
show citation-related text conditionally
fdiblen Aug 21, 2024
43a6ccf
update jinja conditions to fix whitespace and new lines for citation …
fdiblen Aug 21, 2024
512b136
fix merge conflicts
fdiblen Aug 21, 2024
566fe84
update the changelog
fdiblen Aug 21, 2024
06c4823
fix merge conflicts
fdiblen Aug 21, 2024
63800fe
update the citation link to make linter happy
fdiblen Aug 21, 2024
b1a6456
fix merge conflicts
fdiblen Aug 21, 2024
a0d7b16
remove the duplicate line in README.dev.md.jinja
fdiblen Aug 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Added

* Make citation optional [#471](https://github.com/NLeSC/python-template/pull/471)
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)
* Template unit tests for documentation generation, linting and version bumping
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Use this [Copier](https://copier.readthedocs.io) template to generate an empty P
- [Contributing guidelines](template/CONTRIBUTING.md.jinja),
- Continuous code quality and code coverage reporting using [Sonarcloud](https://sonarcloud.io/),
- 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,
- Instructions how to make package [citable](template/.github/next_steps/02_citation.md.jinja)
- 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)
- FAIR software recommendation badge,
- Optional [pre commit hook](template/README.dev.md.jinja#running-linters-locally) to catch lint errors early

Expand Down
6 changes: 6 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ AddGitHubActions:
default: "{{ template_profile != 'minimum' }}"
help: GitHub actions to test the package and the documentation

AddCitation:
when: "{{ template_profile == 'ask' }}"
type: bool
default: "{{ template_profile != 'minimum' }}"
help: Citation file and cffconvert workflow which validates the citation file

AddChangeLog:
when: "{{ template_profile == 'ask' }}"
type: bool
Expand Down
10 changes: 5 additions & 5 deletions profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
- package_name:
- version:
- template_profile:
- minumum --> DONE
- recommeded --> all questions - excluded with the defaults
- minumum --> DONE
- recommeded --> all questions - excluded with the defaults
- optional --> all questions with answers off

- github_organization:
- full_name:
- email:
- copyright_holder:
- licence (exist)

- community:
- code of conduct --> if TRUE ask for email
- contributing guidelines
Expand All @@ -20,7 +20,7 @@
- developer documentation
- online documentation (read the docs)
- project_setup.md

- code quality:
- sonarcloud
- ruff and lint workflow
Expand All @@ -30,7 +30,7 @@

- publishing and release
- zenodo
- keywords
- keywords
- changelog.md
- cffconvert workflow and citation file

Expand Down
21 changes: 6 additions & 15 deletions template/.github/workflows/next_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,30 @@ jobs:
- name: Create Sonarcloud integration issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/01_sonarcloud_integration.md
id: sonarcloud

- name: Create citation data issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/02_citation.md
id: citation
- name: Create Zenodo integration issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/04_zenodo_integration.md
id: zenodo
- name: Create linting issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ '{{ ' -}} secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/05_linting.md
id: linting
- name: List created issues
run: |
echo 'Created issues that must be completed to have fully working Python package:
* Sonarcloud integration ${{ '{{ ' -}} steps.sonarcloud.outputs.url }}
* Zenodo integration ${{ '{{ ' -}} steps.zenodo.outputs.url }}
* Citation data ${{ '{{ ' -}} steps.citation.outputs.url }}
* Linting fixes ${{ '{{ ' -}} steps.linting.outputs.url }}'
* Sonarcloud integration ${{ steps.sonarcloud.outputs.url }}
* Zenodo integration ${{ steps.zenodo.outputs.url }}
* Linting fixes ${{ steps.linting.outputs.url }}'
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on: [push]
permissions:
contents: write
issues: write
name: Create an issue for citation
jobs:
next_steps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create citation data issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/next_steps/02_citation.md
id: citation
- name: List created issues
run: |
echo 'Created issues that must be completed to have fully working Python package:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing ' at the end of the line

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run echo 'Created issues that must be completed to have fully working Python package:
/home/runner/work/_temp/9d06e288-374f-4dd9-b641-81ec33ef6439.sh: line 1: unexpected EOF while looking for matching `''
Error: Process completed with exit code 2.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* Citation data ${{ steps.citation.outputs.url }}'
- name: Cleanup files needed to create next steps issues
run: |
git config --global user.name 'NLeSC Python template'
git config --global user.email '[email protected]'
git rm .github/workflows/next_steps_citation.yml
git rm -r .github/next_steps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a problem for jobs running in parallel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

git commit -am "Cleanup automated next steps issue generator"
git push
4 changes: 2 additions & 2 deletions template/CONTRIBUTING.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ In case you feel like you've made a valuable contribution, but you don't know ho

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 AddCitation -%}1. Check the author list in [`CITATION.cff`](CITATION.cff){%- endif %}
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).
{% if AddChangeLog -%}
1. Update the `CHANGELOG.md` to include changes made
{%- endif %}
Expand Down
4 changes: 0 additions & 4 deletions template/MANIFEST.in

This file was deleted.

4 changes: 4 additions & 0 deletions template/MANIFEST.in.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% if AddCitation -%}include CITATION.cff{%- endif %}
include LICENSE
include NOTICE
include README.md
5 changes: 2 additions & 3 deletions template/README.dev.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ 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)
{%- endif %}
{% if AddChangeLog -%}1. Update the <CHANGELOG.md> (don't forget to update links at bottom of page).{%- endif %}
{% if AddCitation -%}1. Verify that the information in [`CITATION.cff`](CITATION.cff) is correct.{%- endif %}
1. Verify that the information in [`CITATION.cff`](CITATION.cff) is correct.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a duplicate. Should be removed.

1. Make sure the [version has been updated](#versioning).
1. Run the unit tests with `pytest -v`
Expand Down
2 changes: 2 additions & 0 deletions template/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
{%- endif -%}
| **GitHub Actions** | &nbsp; |
| Build | [![build]({{repository_url}}/actions/workflows/build.yml/badge.svg)]({{repository_url}}/actions/workflows/build.yml) |
{% if AddCitation -%}
| Citation data consistency | [![cffconvert]({{repository_url}}/actions/workflows/cffconvert.yml/badge.svg)]({{repository_url}}/actions/workflows/cffconvert.yml) |
{%- endif -%}
| SonarCloud | [![sonarcloud]({{repository_url}}/actions/workflows/sonarcloud.yml/badge.svg)]({{repository_url}}/actions/workflows/sonarcloud.yml) |
| MarkDown link checker | [![markdown-link-check]({{repository_url}}/actions/workflows/markdown-link-check.yml/badge.svg)]({{repository_url}}/actions/workflows/markdown-link-check.yml) |

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 @@ -92,11 +92,13 @@ help you decide which tool to use for packaging.
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/releases?id=changelogmd)
{%- endif %}

{% if AddCitation -%}
## CITATION.cff

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

## CODE_OF_CONDUCT.md

Expand Down
2 changes: 2 additions & 0 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ filename = "src/{{ package_name }}/__init__.py"
[[tool.bumpversion.files]]
filename = "pyproject.toml"

{% if AddCitation -%}
[[tool.bumpversion.files]]
filename = "CITATION.cff"
{%- endif %}

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