From 149a633dc80483ad98dd6870303c533f00eef36e Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 28 Aug 2024 15:59:54 +0200 Subject: [PATCH 01/28] add year and the copyright owner to the generated Apache 2.0 license file --- template/{% if license == 'Apachev2' %}LICENSE{% endif %}.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 6559729dfc34f5083baff4497f80a8e74583c356 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 28 Aug 2024 16:02:24 +0200 Subject: [PATCH 02/28] add year and the copyright owner to the generated GNU Public license v3 license file --- template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja b/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja index f288702d..31f55294 100644 --- a/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja +++ b/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja @@ -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. From 16b3a04dfd6330a3f141eb8285e209d807be9460 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 28 Aug 2024 16:03:27 +0200 Subject: [PATCH 03/28] add year and the copyright owner to the generated Other license file --- template/{% if license == 'Other' %}LICENSE{% endif %}.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }} From 60775bf2b44178f8a814f7fa25ae59d42bfb2de8 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 28 Aug 2024 16:05:12 +0200 Subject: [PATCH 04/28] update the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd611f86..f43fa190 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476) ### Changed +* license files includes year and copyright owner information [#629](https://github.com/NLeSC/python-template/pull/629) * added value field to license options [#617](https://github.com/NLeSC/python-template/pull/617) * fix filename typo of githooks [#611](https://github.com/NLeSC/python-template/pull/609) * next_steps.md is shown as a copier message [#609](https://github.com/NLeSC/python-template/pull/609) From 8f22f98e6fddc9339ed4b10c4e115c380691d944 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 28 Aug 2024 17:51:54 +0200 Subject: [PATCH 05/28] ask copyright holder in all profiles --- copier/questions/essential.yml | 5 +++++ copier/questions/package_details.yml | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 6bb14c7e..8c289443 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -42,3 +42,8 @@ license: Other (add your own license): value: Other default: "Apachev2" +copyright_holder: + type: str + placeholder: Netherlands eScience Center + help: Who is the copyright holder? + when: "{{ template_profile != 'minimum' and AddPackageDetails }}" diff --git a/copier/questions/package_details.yml b/copier/questions/package_details.yml index 79fdb68d..10874bd6 100644 --- a/copier/questions/package_details.yml +++ b/copier/questions/package_details.yml @@ -53,11 +53,7 @@ code_of_conduct_email: {% if not (code_of_conduct_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 - placeholder: Netherlands eScience Center - help: Who is the copyright holder? - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + # calculated fields for GitHub repository: From a2459a2a5d4f3f481c6d9797063635b57cb83f9e Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 28 Aug 2024 17:53:18 +0200 Subject: [PATCH 06/28] update the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f43fa190..91f3f572 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476) ### 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) * added value field to license options [#617](https://github.com/NLeSC/python-template/pull/617) * fix filename typo of githooks [#611](https://github.com/NLeSC/python-template/pull/609) From 09574caa831afe2978a1359fa43058b5d7f5bdde Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Wed, 28 Aug 2024 17:54:51 +0200 Subject: [PATCH 07/28] add a validator to copyright holder --- copier/questions/essential.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 8c289443..82209113 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -46,4 +46,7 @@ copyright_holder: type: str placeholder: Netherlands eScience Center help: Who is the copyright holder? - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + validator: >- + {% if not copyright_holder %} + This field cannot be empty + {% endif %} From 758b28a53194b012de4600f52b5f0a20b321bf43 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Sat, 31 Aug 2024 19:12:37 +0200 Subject: [PATCH 08/28] create .github/workflows only when a github action is enabled --- copier.yml | 12 ++++++++---- copier/global_flags.yml | 16 ++++++++++++++++ ... if AddCFFConvert %}cffconvert.yml{% endif %} | 0 ...Citation %}next_steps_citation.yml{% endif %} | 0 ...next_steps_citation_issue.md{% endif %}.jinja | 0 ...itHubActionBuild %}build.yml{% endif %}.jinja | 0 ...nDocumentation %}documentation.yml{% endif %} | 0 ...% if AddLinkCheck %}link-check.yml{% endif %} | 0 ...ddLinting %}next_steps_linting.yml{% endif %} | 0 ...}next_steps_linting_issue.md{% endif %}.jinja | 0 ...ext_steps_online_documentation.yml{% endif %} | 0 ...nline_documentation_issue.md{% endif %}.jinja | 0 ...rCloud %}next_steps_sonarcloud.yml{% endif %} | 0 ...xt_steps_sonarcloud_issue.md{% endif %}.jinja | 0 ... if AddSonarCloud %}sonarcloud.yml{% endif %} | 0 ... AddZenodo %}next_steps_zenodo.yml{% endif %} | 0 ...%}next_steps_zenodo_issue.md{% endif %}.jinja | 0 17 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 copier/global_flags.yml rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddCFFConvert %}cffconvert.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddCitation %}next_steps_citation_issue.md{% endif %}.jinja (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %}.jinja (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddGitHubActionDocumentation %}documentation.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddLinkCheck %}link-check.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddLinting %}next_steps_linting_issue.md{% endif %}.jinja (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation_issue.md{% endif %}.jinja (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud_issue.md{% endif %}.jinja (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddSonarCloud %}sonarcloud.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} (100%) rename template/{.github => {% if HasWorkflows %}.github{% endif %}}/workflows/{% if AddZenodo %}next_steps_zenodo_issue.md{% endif %}.jinja (100%) 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/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.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCitation %}next_steps_citation.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.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinting %}next_steps_linting.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.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} 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.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} 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.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddZenodo %}next_steps_zenodo.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 From b701b07c817ee7f2a34281dd6da9158729d2c071 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Sat, 31 Aug 2024 19:32:00 +0200 Subject: [PATCH 09/28] make the questions more coherent and descriptive --- copier/questions/essential.yml | 9 +++++---- copier/questions/features_code_quality.yml | 9 ++++++--- copier/questions/features_documentation.yml | 4 ++-- copier/questions/features_publish_release.yml | 2 +- copier/questions/package_details.yml | 8 ++++---- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 6bb14c7e..30db60a1 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,3 @@ license: value: GNULesserv3 Other (add your own license): value: Other - default: "Apachev2" 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..a4c147b4 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,7 +29,7 @@ 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,})+')) %} @@ -38,7 +38,7 @@ email: copyright_holder: type: str default: "{{ full_name }}" - help: Who is the copyright holder (the default is your 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. From 9ffb7f185198d9afdef0cc796f2089fcbb923107 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 13:05:09 +0200 Subject: [PATCH 10/28] create the NOTICE file only for Apache license --- ...inja => {% if license == 'Apachev2' %}NOTICE{% endif %}.jinja} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename template/{NOTICE.jinja => {% if license == 'Apachev2' %}NOTICE{% endif %}.jinja} (100%) 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 From 07dda0895889f1452d5a19e8a27238258350769d Mon Sep 17 00:00:00 2001 From: Olga Lyashevska Date: Mon, 2 Sep 2024 13:51:43 +0200 Subject: [PATCH 11/28] adjusr settings --- copier/settings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From cf3c1353f899c03a03b9a043305ddc16bb17e076 Mon Sep 17 00:00:00 2001 From: Olga Lyashevska Date: Mon, 2 Sep 2024 14:10:25 +0200 Subject: [PATCH 12/28] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55117537..0dca3482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,14 @@ ### 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 ### 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 From 5fbeee332daaf28a78ba21729a56d60c5c119a7f Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 17:24:32 +0200 Subject: [PATCH 13/28] add year and copyright owner to GNU v3 --- template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja b/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja index 31f55294..63c5f3ef 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 From e5ad01071da15dcac958702de25702a18d4121c0 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 17:25:47 +0200 Subject: [PATCH 14/28] remove the comma in GNU v3 license --- template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja b/template/{% if license == 'GNUv3' %}LICENSE{% endif %}.jinja index 63c5f3ef..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) {{ '%Y' | strftime }}, {{ copyright_holder }} + 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 From e149accb5aa401b4c343f68b5de8e95267e52457 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 17:30:35 +0200 Subject: [PATCH 15/28] update the changelog for the release --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f01cca..8c96dc7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ ### Added +### Changed + +### 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 @@ -14,7 +22,7 @@ ### 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 From 5d9efd317ab1747ff577d958d2ddf2d99829db25 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 17:31:19 +0200 Subject: [PATCH 16/28] bump to 0.6.1 --- CITATION.cff | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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] From 8f7e61ce2f00c5a7cc340fab18b4e460e7a02f0c Mon Sep 17 00:00:00 2001 From: Olga Lyashevska Date: Mon, 2 Sep 2024 18:53:22 +0200 Subject: [PATCH 17/28] fix linting --- template/src/{{package_name}}/__init__.py.jinja | 1 + .../test_my_module.py.jinja | 1 + 2 files changed, 2 insertions(+) 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 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 From 44f18d6361ebcde66a4662db5decc36c164f7990 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 19:28:08 +0200 Subject: [PATCH 18/28] add next steps workflows to a single file --- ...ation %}next_steps_citation.yml{% endif %} | 30 ----- ...inting %}next_steps_linting.yml{% endif %} | 30 ----- ..._steps_online_documentation.yml{% endif %} | 30 ----- ...oud %}next_steps_sonarcloud.yml{% endif %} | 30 ----- ...dZenodo %}next_steps_zenodo.yml{% endif %} | 31 ----- ...f HasWorkflows %}next_steps.yml{% endif %} | 124 ++++++++++++++++++ 6 files changed, 124 insertions(+), 151 deletions(-) delete mode 100644 template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} delete mode 100644 template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} delete mode 100644 template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} delete mode 100644 template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} delete mode 100644 template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} create mode 100644 template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} diff --git a/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddCitation %}next_steps_citation.yml{% endif %} deleted file mode 100644 index bd6c1f00..00000000 --- a/template/{% if HasWorkflows %}.github{% endif %}/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/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddLinting %}next_steps_linting.yml{% endif %} deleted file mode 100644 index 9be89e43..00000000 --- a/template/{% if HasWorkflows %}.github{% endif %}/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/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddOnlineDocumentation %}next_steps_online_documentation.yml{% endif %} deleted file mode 100644 index c9f29e84..00000000 --- a/template/{% if HasWorkflows %}.github{% endif %}/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/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddSonarCloud %}next_steps_sonarcloud.yml{% endif %} deleted file mode 100644 index 576a7642..00000000 --- a/template/{% if HasWorkflows %}.github{% endif %}/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/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if AddZenodo %}next_steps_zenodo.yml{% endif %} deleted file mode 100644 index 17b5d66d..00000000 --- a/template/{% if HasWorkflows %}.github{% endif %}/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/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} new file mode 100644 index 00000000..61c72fb4 --- /dev/null +++ b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} @@ -0,0 +1,124 @@ +on: [push] +permissions: + contents: write + issues: write +name: Create an 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.yml + 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.yml + 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.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 +{%- 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.yml + 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.yml + git rm .github/workflows/next_steps_sonarcloud_issue.md + git commit -am "Cleanup automated next steps issue generator for sonarcloud" + git push +{%- endif %} From 987751ec261c60b13ee487b7c9cfe1d5f05bcda0 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 19:33:37 +0200 Subject: [PATCH 19/28] remove next_steps.yml after creating all the issues --- .../{% if HasWorkflows %}next_steps.yml{% endif %} | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} index 61c72fb4..93bc0a05 100644 --- a/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} +++ b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} @@ -8,6 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + {%- if AddCitation %} - name: Create citation data issue uses: JasonEtco/create-an-issue@v2 @@ -122,3 +123,14 @@ jobs: 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 %} From 1e9a64e5fdf229ac228e4fa43c7cfeb129b6f317 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 19:35:20 +0200 Subject: [PATCH 20/28] fix next steps workflow name --- ...if %} => {% if HasWorkflows %}next_steps.yml{% endif %}.jinja} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename template/{% if HasWorkflows %}.github{% endif %}/workflows/{{% if HasWorkflows %}next_steps.yml{% endif %} => {% if HasWorkflows %}next_steps.yml{% endif %}.jinja} (100%) diff --git a/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} b/template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %}.jinja similarity index 100% rename from template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %} rename to template/{% if HasWorkflows %}.github{% endif %}/workflows/{% if HasWorkflows %}next_steps.yml{% endif %}.jinja From 2797796eeb3e5b1a4db4c8986464c73eeaf1d092 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 19:39:29 +0200 Subject: [PATCH 21/28] add raw escape to fix secrets --- ...% if HasWorkflows %}next_steps.yml{% endif %}.jinja | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 index 93bc0a05..fc593976 100644 --- 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 @@ -13,7 +13,7 @@ jobs: - name: Create citation data issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} with: filename: .github/workflows/next_steps_citation_issue.md id: citation @@ -36,7 +36,7 @@ jobs: - name: Create linting issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} with: filename: .github/workflows/next_steps_linting_issue.md id: linting @@ -59,7 +59,7 @@ jobs: - name: Create online documentation issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} with: filename: .github/workflows/next_steps_online_documentation_issue.md id: readthedocs @@ -82,7 +82,7 @@ jobs: - name: Create Zenodo integration issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} with: filename: .github/workflows/next_steps_zenodo_issue.md id: zenodo @@ -105,7 +105,7 @@ jobs: - name: Create Sonarcloud issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} with: filename: .github/workflows/next_steps_sonarcloud_issue.md id: sonarcloud From cc43ad9225212dd399c0190cfd1fd9d4d903ae48 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 19:43:07 +0200 Subject: [PATCH 22/28] add string escape to fix secrets --- ...% if HasWorkflows %}next_steps.yml{% endif %}.jinja | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 index fc593976..626b699b 100644 --- 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 @@ -13,7 +13,7 @@ jobs: - name: Create citation data issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} with: filename: .github/workflows/next_steps_citation_issue.md id: citation @@ -36,7 +36,7 @@ jobs: - name: Create linting issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} with: filename: .github/workflows/next_steps_linting_issue.md id: linting @@ -59,7 +59,7 @@ jobs: - name: Create online documentation issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} with: filename: .github/workflows/next_steps_online_documentation_issue.md id: readthedocs @@ -82,7 +82,7 @@ jobs: - name: Create Zenodo integration issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} with: filename: .github/workflows/next_steps_zenodo_issue.md id: zenodo @@ -105,7 +105,7 @@ jobs: - name: Create Sonarcloud issue uses: JasonEtco/create-an-issue@v2 env: - GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %} + GITHUB_TOKEN: {{ '${{' }}secrets.GITHUB_TOKEN{{ '}}' }} with: filename: .github/workflows/next_steps_sonarcloud_issue.md id: sonarcloud From 652825d0ba0890461fa07bdee20849e48310cba9 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 19:50:28 +0200 Subject: [PATCH 23/28] add string escape to fix steps --- ...orkflows %}next_steps.yml{% endif %}.jinja | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 index 626b699b..71cd9183 100644 --- 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 @@ -19,8 +19,8 @@ jobs: 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 }}' + 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' @@ -42,8 +42,8 @@ jobs: 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 }}' + 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' @@ -65,8 +65,8 @@ jobs: 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 }}' + 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' @@ -88,8 +88,8 @@ jobs: 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 }}' + 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' @@ -111,8 +111,8 @@ jobs: 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 }}' + 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' From aa0a84c3efb4db1c51faf9c745e567ff7380a57a Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 19:57:31 +0200 Subject: [PATCH 24/28] update the git commands to fix next steps workflow --- .../{% if HasWorkflows %}next_steps.yml{% endif %}.jinja | 5 ----- 1 file changed, 5 deletions(-) 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 index 71cd9183..cef8e22b 100644 --- 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 @@ -26,7 +26,6 @@ jobs: 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 @@ -49,7 +48,6 @@ jobs: 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 @@ -72,7 +70,6 @@ jobs: 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 @@ -95,7 +92,6 @@ jobs: 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 @@ -118,7 +114,6 @@ jobs: 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 From 419e7c3bdc79b52710ae81e31cab95d54d5a0a01 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 20:07:17 +0200 Subject: [PATCH 25/28] fix date-released field and remove license from CITATION.cff to make cffconvert action work --- ...% if AddCitation %}CITATION.cff{% endif %}.jinja | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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] }} From 6ad148624ff3adf4b2db241a4d0d1124e8ea31ee Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 2 Sep 2024 23:43:59 +0200 Subject: [PATCH 26/28] update next steps workflow name --- .../{% if HasWorkflows %}next_steps.yml{% endif %}.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index cef8e22b..b0fbef61 100644 --- 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 @@ -2,7 +2,7 @@ on: [push] permissions: contents: write issues: write -name: Create an issues +name: Create GitHub issues jobs: next_steps: runs-on: ubuntu-latest From d16e3578f07aa4f0f9eb64d00d5c97a7cdb60f64 Mon Sep 17 00:00:00 2001 From: fdiblen <144492+fdiblen@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:58:04 +0200 Subject: [PATCH 27/28] Update issue templates --- .github/ISSUE_TEMPLATE/01_bug_report.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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** From bc84087c8e19be0acf1fd3ac76f26cc9be150b3b Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Tue, 3 Sep 2024 10:57:15 +0200 Subject: [PATCH 28/28] update the changelog for the release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c96dc7e..3aaf96b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ * 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