diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md index a97cba64..1428e3ec 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.md +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve title: '' -labels: 'bug' +labels: bug assignees: '' --- @@ -44,9 +44,7 @@ If applicable, add screenshots to help explain your problem. - [ ] minimum - [ ] let me choose - OS: - - version: - **Additional context** diff --git a/CHANGELOG.md b/CHANGELOG.md index 55117537..3aaf96b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,23 @@ ### Removed +## 0.6.1 + +### Added + +* Add .gitignore and .editorconfig to the list of files that are not updated if they exist [#655](https://github.com/NLeSC/python-template/pull/655) + +### Changed + +* copyright owner is asked in all profiles [#629](https://github.com/NLeSC/python-template/pull/629) +* license files includes year and copyright owner information [#629](https://github.com/NLeSC/python-template/pull/629) +* combine all the next step jobs in a single workflow [#657](https://github.com/NLeSC/python-template/pull/657) +* fix CITATION.cff validation issues which also helps cffconvert workflow to pass [#657](https://github.com/NLeSC/python-template/pull/657) + +### Removed + +* Remove pyproject.toml and CITATION.cff from the list of files that are not updated if they exist [#655](https://github.com/NLeSC/python-template/pull/655) + ## [0.6.0] ### Added diff --git a/CITATION.cff b/CITATION.cff index 7cc7b192..098fc45d 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -95,4 +95,4 @@ license: Apache-2.0 message: "If you use this software, please cite it using these metadata." repository-code: "https://github.com/NLeSC/python-template" title: "Netherlands eScience Center Python Template" -version: "0.6.0" +version: "0.6.1" diff --git a/copier.yml b/copier.yml index 398a557d..b9ef5ab7 100644 --- a/copier.yml +++ b/copier.yml @@ -15,21 +15,25 @@ !include copier/questions/package_details.yml --- -# code quality +# code quality features !include copier/questions/features_code_quality.yml --- -# publish and release +# publish and release features !include copier/questions/features_publish_release.yml --- -# publish and release +# publish and release features !include copier/questions/features_documentation.yml --- -# community +# community features !include copier/questions/features_community.yml +--- +# global flags +!include copier/global_flags.yml + --- # User messages !include copier/messages.yml diff --git a/copier/global_flags.yml b/copier/global_flags.yml new file mode 100644 index 00000000..11702aeb --- /dev/null +++ b/copier/global_flags.yml @@ -0,0 +1,16 @@ +--- +# Computed values that depend on multiple values + +HasWorkflows: + type: bool + default: "{{ + AddGitHubActionBuild + or AddGitHubActionDocumentation + or AddLinkCheck + or AddCFFConvert + or AddCitation + or AddOnlineDocumentation + or AddSonarCloud + or AddZenodo + or AddLinting }}" + when: false diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 6bb14c7e..d57838c7 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -2,8 +2,8 @@ # Essential questions package_name: type: str - placeholder: my_python_package - help: Enter the name of the Python package. + placeholder: your_python_package + help: Enter the name of the Python package validator: >- {% if not (package_name | regex_search('^[a-z][a-z0-9\_]+$')) %} Package name must start with a letter, followed one or more letters, digits or underscores all lowercase @@ -22,10 +22,12 @@ full_name: help: Enter your full name validator: >- {% if not full_name %} - Name cannot be empty + Full name cannot be empty! {% endif %} license: type: str + default: "Apachev2" + help: "Select a license (see: https://choosealicense.com)" choices: Apache License, Version 2.0: value: Apachev2 @@ -41,4 +43,11 @@ license: value: GNULesserv3 Other (add your own license): value: Other - default: "Apachev2" +copyright_holder: + type: str + default: "{{ full_name }}" + help: "Who is the copyright holder (default: full name)?" + validator: >- + {% if not copyright_holder %} + This field cannot be empty as it will be used in content of the generated files. + {% endif %} diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index 64adc43f..82a0afc7 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -14,10 +14,10 @@ SelectCodeQualityFeatures: help: Select code quality features multiselect: true choices: - Local tests: + Unit tests (using pytest): value: AddLocalTests_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" - GitHub Actions (selection on the next menu): + GitHub Actions (select in the next step): value: SelectGitHubActions_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Linting: @@ -58,7 +58,10 @@ SelectGitHubActions: # computed features AddLocalTests: type: bool - default: "{{ 'AddLocalTests_flag' in SelectCodeQualityFeatures or 'AddGitHubActionBuild_flag' in SelectGitHubActions or 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}" + default: "{{ + 'AddLocalTests_flag' in SelectCodeQualityFeatures + or 'AddGitHubActionBuild_flag' in SelectGitHubActions + or 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}" when: false AddGitHubActionBuild: type: bool diff --git a/copier/questions/features_documentation.yml b/copier/questions/features_documentation.yml index 6316ccbb..cc4098d3 100644 --- a/copier/questions/features_documentation.yml +++ b/copier/questions/features_documentation.yml @@ -14,10 +14,10 @@ SelectDocumentationFeatures: help: Select documentation features multiselect: true choices: - Local documentation: + Local documentation (using sphinx): value: AddLocalDocumentation_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" - Online documentation (Read the Docs): + Online documentation (using Read the Docs): value: AddOnlineDocumentation_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Developer documentation: diff --git a/copier/questions/features_publish_release.yml b/copier/questions/features_publish_release.yml index 3e0b026e..953ff204 100644 --- a/copier/questions/features_publish_release.yml +++ b/copier/questions/features_publish_release.yml @@ -14,7 +14,7 @@ SelectPublishReleaseFeatures: help: Select publish and release features multiselect: true choices: - Citation (selection on the next menu): + Citation (select in the next step): value: SelectCitation_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Changelog: diff --git a/copier/questions/package_details.yml b/copier/questions/package_details.yml index 334c9b53..a163d554 100644 --- a/copier/questions/package_details.yml +++ b/copier/questions/package_details.yml @@ -18,10 +18,10 @@ package_short_description: keywords: type: str placeholder: keyword1,second keyword,third keyword - help: Add keywords to make your package findable on PyPI + help: Add keywords to make your package findable on PyPI (comma-separated) github_organization: type: str - placeholder: "your-github-username or your-github-organization" + placeholder: "your_github_username or your_github_organization" help: Enter the name of your GitHub username or organization validator: >- {% if not (github_organization | regex_search('^\\S*$')) %} @@ -29,20 +29,12 @@ github_organization: {% endif %} email: type: str - placeholder: yourname@esciencecenter.nl + placeholder: yourname@universe.com help: What is your email address? validator: >- {% if not (email | regex_search('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')) %} Please enter a valid email address {% endif %} -copyright_holder: - type: str - default: "{{ full_name }}" - help: Who is the copyright holder (the default is your full name)? - validator: >- - {% if not copyright_holder %} - This field cannot be empty as it will be used in content of the generated files. - {% endif %} # computed fields diff --git a/copier/settings.yml b/copier/settings.yml index cd2071bd..2593015b 100644 --- a/copier/settings.yml +++ b/copier/settings.yml @@ -3,8 +3,8 @@ _subdirectory: template # Settings like `_skip_if_exists` are merged _skip_if_exists: - - "pyproject.toml" - - CITATION.cff - LICENSE - CHANGELOG.md - CODE_OF_CONDUCT.md + - .gitignore + - .editorconfig diff --git a/setup.cfg b/setup.cfg index 18b76a6c..a0edb730 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ name = Netherlands eScience Center Python Template project_urls = Bug Tracker = https://github.com/NLeSC/python-template/issues url = https://github.com/NLeSC/python-template -version = 0.6.0 +version = 0.6.1 [options] diff --git a/template/.github/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} b/template/.github/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} deleted file mode 100644 index bd6c1f00..00000000 --- a/template/.github/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} +++ /dev/null @@ -1,30 +0,0 @@ -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/workflows/next_steps_citation_issue.md - id: citation - - name: List created issues - run: | - echo 'Created issues that must be completed to have fully working Python package: - * 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 'nlesc-python-template@users.noreply.github.com' - git pull # other next step workflows may push changes before - git rm .github/workflows/next_steps_citation.yml - git rm .github/workflows/next_steps_citation_issue.md - git commit -am "Cleanup automated next steps issue generator for citation" - git push diff --git a/template/.github/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} b/template/.github/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} deleted file mode 100644 index 9be89e43..00000000 --- a/template/.github/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} +++ /dev/null @@ -1,30 +0,0 @@ -on: [push] -permissions: - contents: write - issues: write -name: Create issues for linting -jobs: - next_steps: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Create linting issue - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - filename: .github/workflows/next_steps_linting_issue.md - id: linting - - name: List created issues - run: | - echo 'Created issues that must be completed to have fully working Python package: - * Linting fixes ${{ steps.linting.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 'nlesc-python-template@users.noreply.github.com' - git pull # other next step workflows may push changes before - git rm .github/workflows/next_steps_linting.yml - git rm .github/workflows/next_steps_linting_issue.md - git commit -am "Cleanup automated next steps issue generator" - git push diff --git a/template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} b/template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} deleted file mode 100644 index c9f29e84..00000000 --- a/template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} +++ /dev/null @@ -1,30 +0,0 @@ -on: [push] -permissions: - contents: write - issues: write -name: Create an issue for online documentation -jobs: - next_steps: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Create online documentation issue - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - filename: .github/workflows/next_steps_online_documentation_issue.md - id: readthedocs - - name: List created issues - run: | - echo 'Created issues that must be completed to have fully working Python package: - * Read the Docs instructions ${{ steps.readthedocs.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 'nlesc-python-template@users.noreply.github.com' - git pull # other next step workflows may push changes before - git rm .github/workflows/next_steps_online_documentation.yml - git rm .github/workflows/next_steps_online_documentation_issue.md - git commit -am "Cleanup automated next steps issue generator for online documentation" - git push diff --git a/template/.github/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} b/template/.github/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} deleted file mode 100644 index 576a7642..00000000 --- a/template/.github/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} +++ /dev/null @@ -1,30 +0,0 @@ -on: [push] -permissions: - contents: write - issues: write -name: Create an issue for Sonarcloud -jobs: - next_steps: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Create Sonarcloud issue - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - filename: .github/workflows/next_steps_sonarcloud_issue.md - id: sonarcloud - - name: List created issues - run: | - echo 'Created issues that must be completed to have fully working Python package: - * Sonarcloud integration ${{ steps.sonarcloud.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 'nlesc-python-template@users.noreply.github.com' - git pull # other next step workflows may push changes before - git rm .github/workflows/next_steps_sonarcloud.yml - git rm .github/workflows/next_steps_sonarcloud_issue.md - git commit -am "Cleanup automated next steps issue generator for sonarcloud" - git push diff --git a/template/.github/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} b/template/.github/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} deleted file mode 100644 index 17b5d66d..00000000 --- a/template/.github/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} +++ /dev/null @@ -1,31 +0,0 @@ -on: [push] -permissions: - contents: write - issues: write -name: Create an issue for Zenodo -jobs: - next_steps: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Create Zenodo integration issue - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - filename: .github/workflows/next_steps_zenodo_issue.md - id: zenodo - - name: List created issues - run: | - echo 'Created issues that must be completed to have fully working Python package: - * Sonarcloud integration ${{ steps.sonarcloud.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 'nlesc-python-template@users.noreply.github.com' - git pull # other next step workflows may push changes before - git rm .github/workflows/next_steps_zenodo.yml - git rm .github/workflows/next_steps_zenodo_issue.md - git commit -am "Cleanup automated next steps issue generator for zenodo" - git push - diff --git a/template/src/{{package_name}}/__init__.py.jinja b/template/src/{{package_name}}/__init__.py.jinja index 9d801f51..c2e457c9 100644 --- a/template/src/{{package_name}}/__init__.py.jinja +++ b/template/src/{{package_name}}/__init__.py.jinja @@ -1,4 +1,5 @@ """Documentation about {{ package_name }}.""" + import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) diff --git a/template/{% if AddCitation %}CITATION.cff{% endif %}.jinja b/template/{% if AddCitation %}CITATION.cff{% endif %}.jinja index ab43a90a..699d11fe 100644 --- a/template/{% if AddCitation %}CITATION.cff{% endif %}.jinja +++ b/template/{% if AddCitation %}CITATION.cff{% endif %}.jinja @@ -3,12 +3,10 @@ cff-version: "1.2.0" title: "{{ package_name }}" authors: - - - family-names: {{ full_name.replace('\"', '\\\"').split(' ')[-1] }} + - family-names: {{ full_name.replace('\"', '\\\"').split(' ')[-1] }} given-names: {{ full_name.replace('\"', '\\\"').split(' ')[0] }} orcid: "https://orcid.org/0000-0000-0000-0000" -date-released: 20??-MM-DD -doi: +date-released: {{ '%Y-%m-%d' | strftime }} version: "{{ version }}" repository-code: "{{ repository_url }}" keywords: @@ -16,10 +14,3 @@ keywords: - "{{ item }}" {%- endfor %} message: "If you use this software, please cite it using these metadata." -{{ { "Apache Software License 2.0": "license: Apache-2.0", - "MIT license": "license: MIT", - "BSD license": "license: BSD-3-Clause", - "ISC license": "license: ISC", - "GNU General Public License v3 or later": "license: GPL-3.0-or-later", - "Not open source": "" -}[license] }} diff --git a/template/{% if AddLocalTests %}tests{% endif %}/test_my_module.py.jinja b/template/{% if AddLocalTests %}tests{% endif %}/test_my_module.py.jinja index ab73013d..bb26591e 100644 --- a/template/{% if AddLocalTests %}tests{% endif %}/test_my_module.py.jinja +++ b/template/{% if AddLocalTests %}tests{% endif %}/test_my_module.py.jinja @@ -1,4 +1,5 @@ """Tests for the {{ package_name }}.my_module module.""" + import pytest from {{ package_name }}.my_module import hello diff --git a/template/.github/workflows/{% if AddCFFConvert %}cffconvert.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCFFConvert %}cffconvert.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddCFFConvert %}cffconvert.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCFFConvert %}cffconvert.yml{% endif %} diff --git a/template/.github/workflows/{% if AddCitation %}next_steps_citation_issue.md{% endif %}.jinja b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCitation %}next_steps_citation_issue.md{% endif %}.jinja similarity index 100% rename from template/.github/workflows/{% if AddCitation %}next_steps_citation_issue.md{% endif %}.jinja rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCitation %}next_steps_citation_issue.md{% endif %}.jinja diff --git a/template/.github/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %}.jinja b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %}.jinja similarity index 100% rename from template/.github/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %}.jinja rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %}.jinja diff --git a/template/.github/workflows/{% if AddGitHubActionDocumentation %}documentation.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddGitHubActionDocumentation %}documentation.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddGitHubActionDocumentation %}documentation.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddGitHubActionDocumentation %}documentation.yml{% endif %} diff --git a/template/.github/workflows/{% if AddLinkCheck %}link-check.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinkCheck %}link-check.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddLinkCheck %}link-check.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinkCheck %}link-check.yml{% endif %} diff --git a/template/.github/workflows/{% if AddLinting %}next_steps_linting_issue.md{% endif %}.jinja b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinting %}next_steps_linting_issue.md{% endif %}.jinja similarity index 100% rename from template/.github/workflows/{% if AddLinting %}next_steps_linting_issue.md{% endif %}.jinja rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinting %}next_steps_linting_issue.md{% endif %}.jinja diff --git a/template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation_issue.md{% endif %}.jinja b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation_issue.md{% endif %}.jinja similarity index 100% rename from template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation_issue.md{% endif %}.jinja rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation_issue.md{% endif %}.jinja diff --git a/template/.github/workflows/{% if AddSonarCloud %}next_steps_sonarcloud_issue.md{% endif %}.jinja b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud_issue.md{% endif %}.jinja similarity index 100% rename from template/.github/workflows/{% if AddSonarCloud %}next_steps_sonarcloud_issue.md{% endif %}.jinja rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud_issue.md{% endif %}.jinja diff --git a/template/.github/workflows/{% if AddSonarCloud %}sonarcloud.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}sonarcloud.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddSonarCloud %}sonarcloud.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}sonarcloud.yml{% endif %} diff --git a/template/.github/workflows/{% if AddZenodo %}next_steps_zenodo_issue.md{% endif %}.jinja b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddZenodo %}next_steps_zenodo_issue.md{% endif %}.jinja similarity index 100% rename from template/.github/workflows/{% if AddZenodo %}next_steps_zenodo_issue.md{% endif %}.jinja rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddZenodo %}next_steps_zenodo_issue.md{% endif %}.jinja diff --git a/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %}.jinja b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %}.jinja new file mode 100644 index 00000000..b0fbef61 --- /dev/null +++ b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %}.jinja @@ -0,0 +1,131 @@ +on: [push] +permissions: + contents: write + issues: write +name: Create GitHub issues +jobs: + next_steps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + +{%- if AddCitation %} + - name: Create citation data issue + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} + with: + filename: .github/workflows/next_steps_citation_issue.md + id: citation + - name: List created issues + run: | + echo "Created issues that must be completed to have fully working Python package: + * 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 'nlesc-python-template@users.noreply.github.com' + git pull # other next step workflows may push changes before + git rm .github/workflows/next_steps_citation_issue.md + git commit -am "Cleanup automated next steps issue generator for citation" + git push +{%- endif %} + +{%- if AddLinting %} + - name: Create linting issue + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} + with: + filename: .github/workflows/next_steps_linting_issue.md + id: linting + - name: List created issues + run: | + echo "Created issues that must be completed to have fully working Python package: + * Linting fixes {{ '${{' }} steps.linting.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 'nlesc-python-template@users.noreply.github.com' + git pull # other next step workflows may push changes before + git rm .github/workflows/next_steps_linting_issue.md + git commit -am "Cleanup automated next steps issue generator" + git push +{%- endif %} + +{%- if AddOnlineDocumentation %} + - name: Create online documentation issue + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} + with: + filename: .github/workflows/next_steps_online_documentation_issue.md + id: readthedocs + - name: List created issues + run: | + echo "Created issues that must be completed to have fully working Python package: + * Read the Docs instructions {{ '${{' }} steps.readthedocs.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 'nlesc-python-template@users.noreply.github.com' + git pull # other next step workflows may push changes before + git rm .github/workflows/next_steps_online_documentation_issue.md + git commit -am "Cleanup automated next steps issue generator for online documentation" + git push +{%- endif %} + +{%- if AddZenodo %} + - name: Create Zenodo integration issue + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} + with: + filename: .github/workflows/next_steps_zenodo_issue.md + id: zenodo + - name: List created issues + run: | + echo "Created issues that must be completed to have fully working Python package: + * Sonarcloud integration {{ '${{' }} steps.sonarcloud.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 'nlesc-python-template@users.noreply.github.com' + git pull # other next step workflows may push changes before + git rm .github/workflows/next_steps_zenodo_issue.md + git commit -am "Cleanup automated next steps issue generator for zenodo" + git push +{%- endif %} + +{%- if AddSonarCloud %} + - name: Create Sonarcloud issue + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} + with: + filename: .github/workflows/next_steps_sonarcloud_issue.md + id: sonarcloud + - name: List created issues + run: | + echo "Created issues that must be completed to have fully working Python package: + * Sonarcloud integration {{ '${{' }} steps.sonarcloud.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 'nlesc-python-template@users.noreply.github.com' + git pull # other next step workflows may push changes before + git rm .github/workflows/next_steps_sonarcloud_issue.md + git commit -am "Cleanup automated next steps issue generator for sonarcloud" + git push +{%- endif %} + +{%- if AddCitation or AddLinting or AddOnlineDocumentation or AddZenodo or AddSonarCloud %} + - name: Cleanup files needed to create next steps issues + run: | + git config --global user.name 'NLeSC Python template' + git config --global user.email 'nlesc-python-template@users.noreply.github.com' + git pull # other next step workflows may push changes before + git rm .github/workflows/next_steps.yml + git commit -am "Cleanup automated next steps issue generator" + git push +{%- endif %} diff --git a/template/{% if license == 'Apachev2' %}LICENSE{% endif %}.jinja b/template/{% if license == 'Apachev2' %}LICENSE{% endif %}.jinja index 0183c52a..7d423b82 100644 --- a/template/{% if license == 'Apachev2' %}LICENSE{% endif %}.jinja +++ b/template/{% if license == 'Apachev2' %}LICENSE{% endif %}.jinja @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyy] [name of copyright owner] + Copyright {{ '%Y' | strftime }} {{ copyright_holder }} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/template/NOTICE.jinja b/template/{% if license == 'Apachev2' %}NOTICE{% endif %}.jinja similarity index 100% rename from template/NOTICE.jinja rename to template/{% if license == 'Apachev2' %}NOTICE{% endif %}.jinja diff --git a/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja b/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja index f288702d..c0f825cd 100644 --- a/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja +++ b/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) + Copyright (C) {{ '%Y' | strftime }} {{ copyright_holder }} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) + Copyright (C) {{ '%Y' | strftime }} {{ copyright_holder }} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/template/{% if license == 'Other' %}LICENSE{% endif %}.jinja b/template/{% if license == 'Other' %}LICENSE{% endif %}.jinja index 8716c7ae..df35cc43 100644 --- a/template/{% if license == 'Other' %}LICENSE{% endif %}.jinja +++ b/template/{% if license == 'Other' %}LICENSE{% endif %}.jinja @@ -1 +1 @@ -Add your own license +Copyright (C) {{ '%Y' | strftime }} {{ copyright_holder }}