From bb2dbf06cc2849cda29fa1106bf3a51b4c15631f Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:21:44 +0200 Subject: [PATCH 01/34] add a category for code quality --- copier/questions/features_code_quality.yml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 copier/questions/features_code_quality.yml diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml new file mode 100644 index 00000000..57b433e6 --- /dev/null +++ b/copier/questions/features_code_quality.yml @@ -0,0 +1,24 @@ +--- +# Questions for code quality features +SelectCodeQualityFeatures: + when: "{{ template_profile != 'minimum' }}" + type: str + default: [] + help: Select code quality features + multiselect: true + choices: + GitHub Actions: + value: select_github_actions_flag + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Linting (using ruff NOT_IMPLEMENTED): + value: not_implemented_linting + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Pre-commit: + value: AddPreCommit + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Code analysis (using SonarCloud): + value: AddSonarCloud + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Editorconfig (NOT_IMPLEMENTED): + value: not_implemented_editor_config + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" From 7282976a91f685647e95dfe639769034aede14e6 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:22:22 +0200 Subject: [PATCH 02/34] make category type yaml --- copier/questions/features_code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index 57b433e6..3fc72763 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -2,7 +2,7 @@ # Questions for code quality features SelectCodeQualityFeatures: when: "{{ template_profile != 'minimum' }}" - type: str + type: yaml default: [] help: Select code quality features multiselect: true From e7a3d73d1ddba71d9ee8b6e53e12bcd2db1a80e1 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:23:09 +0200 Subject: [PATCH 03/34] add a list of pre-selected features for recommended profile --- copier/questions/features_code_quality.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index 3fc72763..3d330cd8 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -3,7 +3,12 @@ SelectCodeQualityFeatures: when: "{{ template_profile != 'minimum' }}" type: yaml - default: [] + default: |- + {% if template_profile == 'recommended' %} + [select_github_actions_flag, not_implemented_linting, AddSonarCloud, not_implemented_editor_config] + {%- else -%} + [] + {%- endif %} help: Select code quality features multiselect: true choices: From da8e2368ddd0788d453ad8fbab322e0be09a0c48 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:25:54 +0200 Subject: [PATCH 04/34] add a sub-menu to select GitHub Actions --- copier/questions/features_code_quality.yml | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index 3d330cd8..f26b9000 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -27,3 +27,26 @@ SelectCodeQualityFeatures: Editorconfig (NOT_IMPLEMENTED): value: not_implemented_editor_config # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + +# split AddGitHubActions --> enable_github_actions_build and enable_github_actions_documentation +SelectGitHubActions: + when: "{{ 'select_github_actions_flag' in SelectCodeQualityFeatures }}" + type: yaml + default: |- + {% if template_profile == 'recommended' %} + [not_implemented_enable_github_actions_build, not_implemented_enable_github_actions_documentation] + {%- else -%} + [] + {%- endif %} + help: Select GitHub Action workflows + multiselect: true + choices: + Build (NOT_IMPLEMENTED): + value: not_implemented_enable_github_actions_build + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Documentation (NOT_IMPLEMENTED): + value: not_implemented_enable_github_actions_documentation + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Link checker (reports broken URLs): + value: AddLinkCheck + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" From fd4ec0174e347f0fd24f465919e4319a5069b745 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:33:05 +0200 Subject: [PATCH 05/34] remove code quality questions from questions/features.yml --- copier/questions/features.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/copier/questions/features.yml b/copier/questions/features.yml index c5c6e185..a6aca098 100644 --- a/copier/questions/features.yml +++ b/copier/questions/features.yml @@ -5,21 +5,6 @@ addExtraFeatures: default: yes help: Do you want to add extra features? when: "{{ template_profile == 'ask' }}" -AddLinkCheck: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Do you want to add a GitHub action to check broken links? -AddGitHubActions: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Do you want to add GitHub actions to test the package and the documentation? -AddCitation: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Citation file and cffconvert workflow which validates the citation file AddChangeLog: when: "{{ template_profile == 'ask' }}" type: bool @@ -30,21 +15,11 @@ AddOnlineDocumentation: type: bool default: "{{ template_profile != 'minimum' }}" help: Online documentation using Read the Docs -AddPreCommit: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Add pre-commit hook to check code style and format on every commit? AddZenodo: when: "{{ template_profile == 'ask' }}" type: bool default: "{{ template_profile != 'minimum' }}" help: Create a GitHub issue on how to enable Zenodo integration? -AddSonarCloud: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Add SonarCloud (code analysis service) integration? AddCodeConduct: when: "{{ template_profile == 'ask' }}" type: bool From f1dab0df83b762b5fd6cb16eae16d3dace623a02 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:37:20 +0200 Subject: [PATCH 06/34] add TODO for AddGitHubActions --- copier/questions/features_code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index f26b9000..cd6747ea 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -28,7 +28,7 @@ SelectCodeQualityFeatures: value: not_implemented_editor_config # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" -# split AddGitHubActions --> enable_github_actions_build and enable_github_actions_documentation +# TODO: split AddGitHubActions --> enable_github_actions_build and enable_github_actions_documentation SelectGitHubActions: when: "{{ 'select_github_actions_flag' in SelectCodeQualityFeatures }}" type: yaml From 0672cbbb34c816f88f9f6bd11140f8bc366e67bc Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:46:57 +0200 Subject: [PATCH 07/34] add a category for documentation --- copier/questions/features.yml | 5 ---- copier/questions/features_documentation.yml | 26 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 copier/questions/features_documentation.yml diff --git a/copier/questions/features.yml b/copier/questions/features.yml index a6aca098..a5a8ffb2 100644 --- a/copier/questions/features.yml +++ b/copier/questions/features.yml @@ -30,8 +30,3 @@ AddContributing: type: bool default: "{{ template_profile != 'minimum' }}" help: Add contributing guidelines? -AddDevDoc: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Add developer documentation? diff --git a/copier/questions/features_documentation.yml b/copier/questions/features_documentation.yml new file mode 100644 index 00000000..fd9f535d --- /dev/null +++ b/copier/questions/features_documentation.yml @@ -0,0 +1,26 @@ +--- +# Questions for documentation features +SelectDocumentationFeatures: + when: "{{ template_profile != 'minimum' }}" + type: yaml + default: |- + {% if template_profile == 'recommended' %} + [AddOnlineDocumentation, AddDevDoc, not_implemented_project_setup] + {%- else -%} + [] + {%- endif %} + help: Select documentation features + multiselect: true + choices: + Online documentation (using Read the Docs): + value: AddOnlineDocumentation + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Developer documentation: + value: AddDevDoc + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Project setup description (NOT_IMPLEMENTED): + value: not_implemented_project_setup + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Markdown link checker GitHub Action (NOT_IMPLEMENTED): + value: not_implemented_markdown_link_checker + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" From b27e12221208e9f8715bc78a9fb681bf77a72064 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:49:24 +0200 Subject: [PATCH 08/34] add a category for community --- copier/questions/features_community.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 copier/questions/features_community.yml diff --git a/copier/questions/features_community.yml b/copier/questions/features_community.yml new file mode 100644 index 00000000..c30edf6b --- /dev/null +++ b/copier/questions/features_community.yml @@ -0,0 +1,20 @@ +--- +# Questions for community features +SelectCommunityFeatures: + when: "{{ template_profile != 'minimum' }}" + type: yaml + default: |- + {% if template_profile == 'recommended' %} + [AddCodeConduct, AddContributing] + {%- else -%} + [] + {%- endif %} + help: Select documentation features + multiselect: true + choices: + Code of conduct: + value: AddCodeConduct + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Contributing guidelines: + value: AddContributing + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" From 0e6e210553aa975a0d10cfbcf3119b65a1e4a71b Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:55:08 +0200 Subject: [PATCH 09/34] add a category for publish and release --- copier/questions/features.yml | 32 ------------- copier/questions/features_publish_release.yml | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+), 32 deletions(-) delete mode 100644 copier/questions/features.yml create mode 100644 copier/questions/features_publish_release.yml diff --git a/copier/questions/features.yml b/copier/questions/features.yml deleted file mode 100644 index a5a8ffb2..00000000 --- a/copier/questions/features.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# Questions for features -addExtraFeatures: - type: bool - default: yes - help: Do you want to add extra features? - when: "{{ template_profile == 'ask' }}" -AddChangeLog: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Add a change log to keep track of changes in the package -AddOnlineDocumentation: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Online documentation using Read the Docs -AddZenodo: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Create a GitHub issue on how to enable Zenodo integration? -AddCodeConduct: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Add code of conduct? -AddContributing: - when: "{{ template_profile == 'ask' }}" - type: bool - default: "{{ template_profile != 'minimum' }}" - help: Add contributing guidelines? diff --git a/copier/questions/features_publish_release.yml b/copier/questions/features_publish_release.yml new file mode 100644 index 00000000..bc9a331b --- /dev/null +++ b/copier/questions/features_publish_release.yml @@ -0,0 +1,47 @@ +--- +# Questions for publishing and releasing features +SelectPublishReleaseFeatures: + when: "{{ template_profile != 'minimum' }}" + type: yaml + default: |- + {% if template_profile == 'recommended' %} + [select_citation_flag, AddZenodo] + {%- else -%} + [] + {%- endif %} + help: Select publish and release features + multiselect: true + choices: + Citation: + value: select_citation_flag + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Changelog: + value: AddChangeLog + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Zenodo integration instructions: + value: AddZenodo + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + Package keywords(NOT_IMPLEMENTED): + value: not_implemented_keywords + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + + +# split AddCitation --> enable_citation_file and enable_cffconvert +SelectCitation: + when: "{{ 'select_citation_flag' in SelectPublishReleaseFeatures }}" + type: yaml + default: |- + {% if template_profile == 'recommended' %} + [enable_citation_file, enable_cffconvert] + {%- else -%} + [] + {%- endif %} + help: Select GitHub Action workflows + multiselect: true + choices: + CITATION.cff file (NOT_IMPLEMENTED): + value: enable_citation_file + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + cffconvert GitHub Action (NOT_IMPLEMENTED): + value: enable_cffconvert + # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" From 3f9542ed0d3d9206c3eea4eb5197f5769c94f0dc Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 21:58:01 +0200 Subject: [PATCH 10/34] include feature yaml file in copier.yml --- copier.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/copier.yml b/copier.yml index c6ac62f5..398a557d 100644 --- a/copier.yml +++ b/copier.yml @@ -15,8 +15,20 @@ !include copier/questions/package_details.yml --- -# Features -!include copier/questions/features.yml +# code quality +!include copier/questions/features_code_quality.yml + +--- +# publish and release +!include copier/questions/features_publish_release.yml + +--- +# publish and release +!include copier/questions/features_documentation.yml + +--- +# community +!include copier/questions/features_community.yml --- # User messages From c8ddd59ead7a39105f08ec0aa16aa67def254803 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 22:01:38 +0200 Subject: [PATCH 11/34] add a validator for package version --- copier/questions/essential.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 92db3154..ba047e75 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -12,6 +12,10 @@ version: type: str placeholder: 0.1.0 help: Enter the version of the Python package + validator: >- + {% if not (package_name | regex_search('^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')) %} + Package version should use Semantic Versioning 2.0.0 (MAJOR.MINOR.PATCH) + {% endif %} license: type: str choices: From 2662932cefe376560889a56c6667ad861cd30623 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 22:03:35 +0200 Subject: [PATCH 12/34] make full name an essential question --- copier/questions/essential.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index ba047e75..8bd1bd2a 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -16,6 +16,10 @@ version: {% if not (package_name | regex_search('^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')) %} Package version should use Semantic Versioning 2.0.0 (MAJOR.MINOR.PATCH) {% endif %} +full_name: + type: str + placeholder: Jane Smith + help: Enter your full name license: type: str choices: From d8f98d925907ac75b5f0aba729e22107324174a8 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 22:04:47 +0200 Subject: [PATCH 13/34] update help text and condition for package detail questions --- copier/questions/package_details.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/copier/questions/package_details.yml b/copier/questions/package_details.yml index ce93c7e2..301a5495 100644 --- a/copier/questions/package_details.yml +++ b/copier/questions/package_details.yml @@ -8,43 +8,38 @@ AddPackageDetails: package_short_description: type: str placeholder: Short description - help: Provide a short description of package. + help: Short description of package when: "{{ template_profile != 'minimum' and AddPackageDetails }}" keyword1: type: str placeholder: keyword1 help: Add keyword1 - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + when: "{{ template_profile != 'minimum' and AddPackageDetails }}" keyword2: type: str placeholder: keyword2 help: Add keyword2 - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + when: "{{ template_profile != 'minimum' and AddPackageDetails }}" github_organization: type: str placeholder: "" help: Enter the name of your GitHub username or organization - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" -full_name: - type: str - placeholder: Jane Smith - help: Enter your full name - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + when: "{{ template_profile != 'minimum' and AddPackageDetails }}" email: type: str placeholder: yourname@esciencecenter.nl help: What is your email address? - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + when: "{{ template_profile != 'minimum' and AddPackageDetails }}" code_of_conduct_email: type: str placeholder: yourname@esciencecenter.nl - help: What is the email address of code of conduct? - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + help: What is the email address cor code of conduct? + when: "{{ template_profile != 'minimum' and AddPackageDetails }}" copyright_holder: type: str placeholder: Netherlands eScience Center help: Who is the copyright holder? - when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + when: "{{ template_profile != 'minimum' and AddPackageDetails }}" # calculated fields for GitHub repository: From 7fd5c175c3ac9d07abbbf271daa14d04b4faf5da Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 22:09:14 +0200 Subject: [PATCH 14/34] fix the version validator --- copier/questions/essential.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 8bd1bd2a..f4e2e9ea 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -13,7 +13,7 @@ version: placeholder: 0.1.0 help: Enter the version of the Python package validator: >- - {% if not (package_name | regex_search('^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')) %} + {% if not (version | regex_search('^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')) %} Package version should use Semantic Versioning 2.0.0 (MAJOR.MINOR.PATCH) {% endif %} full_name: From cafb6500716621b4da33f01425f2eefbfcabf33b Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Fri, 23 Aug 2024 22:17:08 +0200 Subject: [PATCH 15/34] use a default value for version --- copier/questions/essential.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index f4e2e9ea..6171d574 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -10,7 +10,7 @@ package_name: {% endif %} version: type: str - placeholder: 0.1.0 + default: 0.1.0 help: Enter the version of the Python package validator: >- {% if not (version | regex_search('^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')) %} From ce00ad2da76c70b45beab979a7f8ad28ebb35cf6 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 15:21:42 +0200 Subject: [PATCH 16/34] disable CITATION.cff in test_bumpversion --- tests/test_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_project.py b/tests/test_project.py index 45118ded..eb989b42 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -212,6 +212,6 @@ def test_bumpversion(baked_with_development_dependencies, project_env_bin_dir): assert '' in result.stdout expected_version = '1.0.0' assert expected_version in (project_dir / 'pyproject.toml').read_text('utf-8') - assert expected_version in (project_dir / 'CITATION.cff').read_text('utf-8') + # assert expected_version in (project_dir / 'CITATION.cff').read_text('utf-8') assert expected_version in (project_dir / 'src' / 'my_python_package' / '__init__.py').read_text('utf-8') assert expected_version in (project_dir / 'docs' / 'conf.py').read_text('utf-8') From 55a247dac16d06892e7690b94ad1726ece9e8290 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 16:18:54 +0200 Subject: [PATCH 17/34] disable CITATION.cff in test_bumpversion --- tests/test_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_project.py b/tests/test_project.py index eb989b42..bd656545 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -203,7 +203,7 @@ def test_bumpversion(baked_with_development_dependencies, project_env_bin_dir): original_version = '0.1.0' assert original_version in (project_dir / 'pyproject.toml').read_text('utf-8') - assert original_version in (project_dir / 'CITATION.cff').read_text('utf-8') + # assert original_version in (project_dir / 'CITATION.cff').read_text('utf-8') assert original_version in (project_dir / 'src' / 'my_python_package' / '__init__.py').read_text('utf-8') assert original_version in (project_dir / 'docs' / 'conf.py').read_text('utf-8') From a0d485fef6c591aaf3eb059be650e99af7d78734 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 17:36:12 +0200 Subject: [PATCH 18/34] add a validator for full name --- copier/questions/essential.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 6171d574..80855ea6 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -20,6 +20,10 @@ full_name: type: str placeholder: Jane Smith help: Enter your full name + validator: >- + {% if not full_name %} + Name cannot be empty + {% endif %} license: type: str choices: From f03d26f0f40e234c704bd13dac483baf27e944ef Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 17:37:02 +0200 Subject: [PATCH 19/34] add validators for description, github organization and emails --- copier/questions/package_details.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/copier/questions/package_details.yml b/copier/questions/package_details.yml index 301a5495..5dcc0860 100644 --- a/copier/questions/package_details.yml +++ b/copier/questions/package_details.yml @@ -10,6 +10,10 @@ package_short_description: placeholder: Short description help: Short description of package when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + validator: >- + {% if not package_short_description %} + Package description cannot be empty + {% endif %} keyword1: type: str placeholder: keyword1 @@ -25,16 +29,28 @@ github_organization: placeholder: "" help: Enter the name of your GitHub username or organization when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + validator: >- + {% if not github_organization %} + This field cannot be empty + {% endif %} email: type: str placeholder: yourname@esciencecenter.nl help: What is your email address? when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + 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 %} code_of_conduct_email: type: str placeholder: yourname@esciencecenter.nl help: What is the email address cor code of conduct? when: "{{ template_profile != 'minimum' and AddPackageDetails }}" + validator: >- + {% 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 From 3eeeae76baab22c04bca314aeb9eade2d4c9bfc2 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 18:05:32 +0200 Subject: [PATCH 20/34] fix apache 2.0 naming issue --- copier/questions/essential.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copier/questions/essential.yml b/copier/questions/essential.yml index 80855ea6..54fe971f 100644 --- a/copier/questions/essential.yml +++ b/copier/questions/essential.yml @@ -27,11 +27,11 @@ full_name: license: type: str choices: - - "Apache Software License 2.0" + - "Apache-2.0" - "MIT license" - "BSD license" - "ISC license" - "GNU General Public License v3 or later" - "GNU Lesser General Public License v3 or later" - "Not open source" - default: "Apache Software License 2.0" + default: "Apache-2.0" From 16e970c99442b0c0891757ab369e922016a00410 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 18:27:08 +0200 Subject: [PATCH 21/34] fix the help field of community features --- copier/questions/features_community.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier/questions/features_community.yml b/copier/questions/features_community.yml index c30edf6b..b1267824 100644 --- a/copier/questions/features_community.yml +++ b/copier/questions/features_community.yml @@ -9,7 +9,7 @@ SelectCommunityFeatures: {%- else -%} [] {%- endif %} - help: Select documentation features + help: Select community features multiselect: true choices: Code of conduct: From f40675b5ebf70a2d236c38051092e7e66436fec9 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 18:29:37 +0200 Subject: [PATCH 22/34] fix the typo in code of conduct help field --- copier/questions/package_details.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copier/questions/package_details.yml b/copier/questions/package_details.yml index 5dcc0860..342ccc6c 100644 --- a/copier/questions/package_details.yml +++ b/copier/questions/package_details.yml @@ -45,7 +45,7 @@ email: code_of_conduct_email: type: str placeholder: yourname@esciencecenter.nl - help: What is the email address cor code of conduct? + help: What is the email address for code of conduct? when: "{{ template_profile != 'minimum' and AddPackageDetails }}" validator: >- {% 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,})+')) %} From 4afb3939f991d0efef23f3ef59d90104737f8b83 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:09:26 +0200 Subject: [PATCH 23/34] use computed values for github actions --- copier/questions/features_code_quality.yml | 30 +++++++++++++------ ...dGitHubActionBuild %}build.yml{% endif %}} | 0 ...umentation %}documentation.yml{% endif %}} | 0 3 files changed, 21 insertions(+), 9 deletions(-) rename template/.github/workflows/{{% if AddGitHubActions %}build.yml{% endif %} => {% if AddGitHubActionBuild %}build.yml{% endif %}} (100%) rename template/.github/workflows/{{% if AddGitHubActions %}documentation.yml{% endif %} => {% if AddGitHubActionDocumentation %}documentation.yml{% endif %}} (100%) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index cd6747ea..40b2cf12 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -5,7 +5,7 @@ SelectCodeQualityFeatures: type: yaml default: |- {% if template_profile == 'recommended' %} - [select_github_actions_flag, not_implemented_linting, AddSonarCloud, not_implemented_editor_config] + [SelectGitHubActions_flag, not_implemented_linting, AddSonarCloud, not_implemented_editor_config] {%- else -%} [] {%- endif %} @@ -13,7 +13,7 @@ SelectCodeQualityFeatures: multiselect: true choices: GitHub Actions: - value: select_github_actions_flag + value: SelectGitHubActions_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Linting (using ruff NOT_IMPLEMENTED): value: not_implemented_linting @@ -28,25 +28,37 @@ SelectCodeQualityFeatures: value: not_implemented_editor_config # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" -# TODO: split AddGitHubActions --> enable_github_actions_build and enable_github_actions_documentation + SelectGitHubActions: - when: "{{ 'select_github_actions_flag' in SelectCodeQualityFeatures }}" + when: "{{ 'SelectGitHubActions_flag' in SelectCodeQualityFeatures }}" type: yaml default: |- {% if template_profile == 'recommended' %} - [not_implemented_enable_github_actions_build, not_implemented_enable_github_actions_documentation] + [AddGitHubActionBuild, AddGitHubActionDocumentation] {%- else -%} [] {%- endif %} help: Select GitHub Action workflows multiselect: true choices: - Build (NOT_IMPLEMENTED): - value: not_implemented_enable_github_actions_build + Build: + value: AddGitHubActionBuild_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" - Documentation (NOT_IMPLEMENTED): - value: not_implemented_enable_github_actions_documentation + Documentation: + value: AddGitHubActionDocumentation_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Link checker (reports broken URLs): value: AddLinkCheck # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + + +# computed features +AddGitHubActionBuild: + type: bool + default: "{{ 'AddGitHubActionBuild_flag' in SelectGitHubActions }}" + when: false + +AddGitHubActionDocumentation: + type: bool + default: "{{ 'AddGitHubActionDocumentation_flag' in SelectGitHubActions }}" + when: false diff --git a/template/.github/workflows/{% if AddGitHubActions %}build.yml{% endif %} b/template/.github/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddGitHubActions %}build.yml{% endif %} rename to template/.github/workflows/{% if AddGitHubActionBuild %}build.yml{% endif %} diff --git a/template/.github/workflows/{% if AddGitHubActions %}documentation.yml{% endif %} b/template/.github/workflows/{% if AddGitHubActionDocumentation %}documentation.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddGitHubActions %}documentation.yml{% endif %} rename to template/.github/workflows/{% if AddGitHubActionDocumentation %}documentation.yml{% endif %} From ac91735363cb5dc6a42cef8197f4a207c6ceb5f4 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:13:37 +0200 Subject: [PATCH 24/34] use computed values for link checker github action --- copier/questions/features_code_quality.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index 40b2cf12..60b9f415 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -48,7 +48,7 @@ SelectGitHubActions: value: AddGitHubActionDocumentation_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Link checker (reports broken URLs): - value: AddLinkCheck + value: AddLinkCheck_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" @@ -62,3 +62,8 @@ AddGitHubActionDocumentation: type: bool default: "{{ 'AddGitHubActionDocumentation_flag' in SelectGitHubActions }}" when: false + +AddLinkCheck: + type: bool + default: "{{ 'AddLinkCheck_flag' in SelectGitHubActions }}" + when: false From a7252438451dab0f0da29af6cf1586b6505efd81 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:18:37 +0200 Subject: [PATCH 25/34] use computed values for precommit and sonarcloud features --- copier/questions/features_code_quality.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index 60b9f415..47a5cb8a 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -1,5 +1,7 @@ --- # Questions for code quality features + +# the main menu SelectCodeQualityFeatures: when: "{{ template_profile != 'minimum' }}" type: yaml @@ -19,16 +21,17 @@ SelectCodeQualityFeatures: value: not_implemented_linting # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Pre-commit: - value: AddPreCommit + value: AddPreCommit_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Code analysis (using SonarCloud): - value: AddSonarCloud + value: AddSonarCloud_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Editorconfig (NOT_IMPLEMENTED): value: not_implemented_editor_config # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" +# Sub-menus SelectGitHubActions: when: "{{ 'SelectGitHubActions_flag' in SelectCodeQualityFeatures }}" type: yaml @@ -67,3 +70,13 @@ AddLinkCheck: type: bool default: "{{ 'AddLinkCheck_flag' in SelectGitHubActions }}" when: false + +AddPreCommit: + type: bool + default: "{{ 'AddPreCommit_flag' in SelectCodeQualityFeatures }}" + when: false + +AddSonarCloud: + type: bool + default: "{{ 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}" + when: false From da7448f54b40dbf300e9d78a1f8efe010d107c37 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:20:41 +0200 Subject: [PATCH 26/34] update selected flags for recommended profile --- copier/questions/features_code_quality.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copier/questions/features_code_quality.yml b/copier/questions/features_code_quality.yml index 47a5cb8a..e85fcdc7 100644 --- a/copier/questions/features_code_quality.yml +++ b/copier/questions/features_code_quality.yml @@ -7,7 +7,7 @@ SelectCodeQualityFeatures: type: yaml default: |- {% if template_profile == 'recommended' %} - [SelectGitHubActions_flag, not_implemented_linting, AddSonarCloud, not_implemented_editor_config] + [SelectGitHubActions_flag, not_implemented_linting, AddSonarCloud_flag, not_implemented_editor_config] {%- else -%} [] {%- endif %} @@ -37,7 +37,7 @@ SelectGitHubActions: type: yaml default: |- {% if template_profile == 'recommended' %} - [AddGitHubActionBuild, AddGitHubActionDocumentation] + [AddGitHubActionBuild_flag, AddGitHubActionDocumentation_flag] {%- else -%} [] {%- endif %} From ad87f5325a5a18c753c248231efd3ef9a0e8d7d1 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:26:32 +0200 Subject: [PATCH 27/34] add computed values and flags for community features --- copier/questions/features_community.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/copier/questions/features_community.yml b/copier/questions/features_community.yml index b1267824..802c8daa 100644 --- a/copier/questions/features_community.yml +++ b/copier/questions/features_community.yml @@ -1,11 +1,13 @@ --- # Questions for community features + +# the main menu SelectCommunityFeatures: when: "{{ template_profile != 'minimum' }}" type: yaml default: |- {% if template_profile == 'recommended' %} - [AddCodeConduct, AddContributing] + [AddCodeConduct_flag, AddContributing_flag] {%- else -%} [] {%- endif %} @@ -13,8 +15,19 @@ SelectCommunityFeatures: multiselect: true choices: Code of conduct: - value: AddCodeConduct + value: AddCodeConduct_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Contributing guidelines: - value: AddContributing + value: AddContributing_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + +# computed features +AddCodeConduct: + type: bool + default: "{{ 'AddCodeConduct_flag' in SelectCommunityFeatures }}" + when: false + +AddContributing: + type: bool + default: "{{ 'AddContributing_flag' in SelectCommunityFeatures }}" + when: false From 5b651a46fc5e288aab74d342361a36421f6fbc99 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:28:29 +0200 Subject: [PATCH 28/34] add computed values and flags for documentation features --- copier/questions/features_documentation.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/copier/questions/features_documentation.yml b/copier/questions/features_documentation.yml index fd9f535d..5893a586 100644 --- a/copier/questions/features_documentation.yml +++ b/copier/questions/features_documentation.yml @@ -1,11 +1,13 @@ --- # Questions for documentation features + +# the main menu SelectDocumentationFeatures: when: "{{ template_profile != 'minimum' }}" type: yaml default: |- {% if template_profile == 'recommended' %} - [AddOnlineDocumentation, AddDevDoc, not_implemented_project_setup] + [AddOnlineDocumentation_flag, AddDevDoc_flag, not_implemented_project_setup] {%- else -%} [] {%- endif %} @@ -13,10 +15,10 @@ SelectDocumentationFeatures: multiselect: true choices: Online documentation (using Read the Docs): - value: AddOnlineDocumentation + value: AddOnlineDocumentation_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Developer documentation: - value: AddDevDoc + value: AddDevDoc_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Project setup description (NOT_IMPLEMENTED): value: not_implemented_project_setup @@ -24,3 +26,14 @@ SelectDocumentationFeatures: Markdown link checker GitHub Action (NOT_IMPLEMENTED): value: not_implemented_markdown_link_checker # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + +# computed features +AddOnlineDocumentation: + type: bool + default: "{{ 'AddOnlineDocumentation_flag' in SelectDocumentationFeatures }}" + when: false + +AddDevDoc: + type: bool + default: "{{ 'AddDevDoc_flag' in SelectDocumentationFeatures }}" + when: false From ba273231ca7453d0f16b7fba6233e276934da65e Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:32:47 +0200 Subject: [PATCH 29/34] add computed values and flags for publish and release features --- copier/questions/features_publish_release.yml | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/copier/questions/features_publish_release.yml b/copier/questions/features_publish_release.yml index bc9a331b..8497d0d7 100644 --- a/copier/questions/features_publish_release.yml +++ b/copier/questions/features_publish_release.yml @@ -1,11 +1,13 @@ --- # Questions for publishing and releasing features + +# the main menu SelectPublishReleaseFeatures: when: "{{ template_profile != 'minimum' }}" type: yaml default: |- {% if template_profile == 'recommended' %} - [select_citation_flag, AddZenodo] + [SelectCitation_flag, AddZenodo] {%- else -%} [] {%- endif %} @@ -13,22 +15,23 @@ SelectPublishReleaseFeatures: multiselect: true choices: Citation: - value: select_citation_flag + value: SelectCitation_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Changelog: - value: AddChangeLog + value: AddChangeLog_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Zenodo integration instructions: - value: AddZenodo + value: AddZenodo_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" Package keywords(NOT_IMPLEMENTED): value: not_implemented_keywords # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" +# Sub-menus # split AddCitation --> enable_citation_file and enable_cffconvert SelectCitation: - when: "{{ 'select_citation_flag' in SelectPublishReleaseFeatures }}" + when: "{{ 'SelectCitation_flag' in SelectPublishReleaseFeatures }}" type: yaml default: |- {% if template_profile == 'recommended' %} @@ -40,8 +43,20 @@ SelectCitation: multiselect: true choices: CITATION.cff file (NOT_IMPLEMENTED): - value: enable_citation_file + value: AddCitationFile_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" cffconvert GitHub Action (NOT_IMPLEMENTED): - value: enable_cffconvert + value: AddCFFConvert_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" + + +# computed features +AddChangeLog: + type: bool + default: "{{ 'AddChangeLog_flag' in SelectPublishReleaseFeatures }}" + when: false + +AddZenodo: + type: bool + default: "{{ 'AddZenodo_flag' in SelectPublishReleaseFeatures }}" + when: false From 4bf594aadcc512edc048fca5d4f6558e03fd1152 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:36:23 +0200 Subject: [PATCH 30/34] fix typo in if condition of CONTRIBUTING.md --- ...a => {% if AddContributing %}CONTRIBUTING.md{% endif %}.jinja} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename template/{{% if AddContribution %}CONTRIBUTING.md{% endif %}.jinja => {% if AddContributing %}CONTRIBUTING.md{% endif %}.jinja} (100%) diff --git a/template/{% if AddContribution %}CONTRIBUTING.md{% endif %}.jinja b/template/{% if AddContributing %}CONTRIBUTING.md{% endif %}.jinja similarity index 100% rename from template/{% if AddContribution %}CONTRIBUTING.md{% endif %}.jinja rename to template/{% if AddContributing %}CONTRIBUTING.md{% endif %}.jinja From 8bbda7c01498d70b8e93bb8277ffbd7ca2e4d3f0 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:40:48 +0200 Subject: [PATCH 31/34] implement the logic for citation, add computed values and flags --- copier/questions/features_publish_release.yml | 16 +++++++++++++--- ...if AddCFFConvert %}cffconvert.yml{% endif %}} | 0 2 files changed, 13 insertions(+), 3 deletions(-) rename template/.github/workflows/{{% if AddCitation %}cffconvert.yml{% endif %} => {% if AddCFFConvert %}cffconvert.yml{% endif %}} (100%) diff --git a/copier/questions/features_publish_release.yml b/copier/questions/features_publish_release.yml index 8497d0d7..82372926 100644 --- a/copier/questions/features_publish_release.yml +++ b/copier/questions/features_publish_release.yml @@ -39,18 +39,28 @@ SelectCitation: {%- else -%} [] {%- endif %} - help: Select GitHub Action workflows + help: Select citation features multiselect: true choices: - CITATION.cff file (NOT_IMPLEMENTED): + CITATION.cff file: value: AddCitationFile_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" - cffconvert GitHub Action (NOT_IMPLEMENTED): + cffconvert GitHub Action (to validate CITATION.cff files): value: AddCFFConvert_flag # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" # computed features +AddCitation: + type: bool + default: "{{ 'AddCitationFile_flag' in SelectCitation }}" + when: false + +AddCFFConvert: + type: bool + default: "{{ 'AddCFFConvert_flag' in SelectCitation }}" + when: false + AddChangeLog: type: bool default: "{{ 'AddChangeLog_flag' in SelectPublishReleaseFeatures }}" diff --git a/template/.github/workflows/{% if AddCitation %}cffconvert.yml{% endif %} b/template/.github/workflows/{% if AddCFFConvert %}cffconvert.yml{% endif %} similarity index 100% rename from template/.github/workflows/{% if AddCitation %}cffconvert.yml{% endif %} rename to template/.github/workflows/{% if AddCFFConvert %}cffconvert.yml{% endif %} From 287e8a9e82561019bbff7a1225f9c2e4a340e622 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:42:57 +0200 Subject: [PATCH 32/34] update selected flags for recommended profile --- copier/questions/features_publish_release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copier/questions/features_publish_release.yml b/copier/questions/features_publish_release.yml index 82372926..8f1d027a 100644 --- a/copier/questions/features_publish_release.yml +++ b/copier/questions/features_publish_release.yml @@ -7,7 +7,7 @@ SelectPublishReleaseFeatures: type: yaml default: |- {% if template_profile == 'recommended' %} - [SelectCitation_flag, AddZenodo] + [SelectCitation_flag, AddZenodo_flag] {%- else -%} [] {%- endif %} @@ -35,7 +35,7 @@ SelectCitation: type: yaml default: |- {% if template_profile == 'recommended' %} - [enable_citation_file, enable_cffconvert] + [AddCitationFile_flag, AddCFFConvert_flag] {%- else -%} [] {%- endif %} From 82a5437150dbdc8b8c60406f325bd0eee83d363b Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 19:51:59 +0200 Subject: [PATCH 33/34] remove link checker from the documentation as it already exists under GitHub Actions --- copier/questions/features_documentation.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/copier/questions/features_documentation.yml b/copier/questions/features_documentation.yml index 5893a586..98e61711 100644 --- a/copier/questions/features_documentation.yml +++ b/copier/questions/features_documentation.yml @@ -23,9 +23,6 @@ SelectDocumentationFeatures: Project setup description (NOT_IMPLEMENTED): value: not_implemented_project_setup # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" - Markdown link checker GitHub Action (NOT_IMPLEMENTED): - value: not_implemented_markdown_link_checker - # validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}" # computed features AddOnlineDocumentation: From 17e4d1fdb19d43327afb044bd60e2d699d6a41d9 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 21:23:19 +0200 Subject: [PATCH 34/34] update the helper of AddPackageDetails --- copier/questions/package_details.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/copier/questions/package_details.yml b/copier/questions/package_details.yml index 342ccc6c..df9673c3 100644 --- a/copier/questions/package_details.yml +++ b/copier/questions/package_details.yml @@ -3,7 +3,9 @@ AddPackageDetails: type: bool default: yes - help: Do you want to add extra details for the package? + help: |- + If you are planning to publish the package it is recommended to provide more details. + Do you want to provide extra details for the package? when: "{{ template_profile != 'minimum'}}" package_short_description: type: str