Skip to content

Commit 1029c53

Browse files
authored
Merge branch 'main' into 599-gitignore
2 parents 6e8ad8e + 2316231 commit 1029c53

11 files changed

Lines changed: 41 additions & 52 deletions

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
### Changed
2020
* Updated .gitignore [#622](https://github.com/NLeSC/python-template/pull/622)
21+
* add extra info for sub-menus [#628](https://github.com/NLeSC/python-template/pull/628)
22+
* skip merging CHANGELOG.md and CODE_OF_CONDUCT.md if they exist [#628](https://github.com/NLeSC/python-template/pull/628)
2123
* added value field to license options [#617](https://github.com/NLeSC/python-template/pull/617)
2224
* fix filename typo of githooks [#611](https://github.com/NLeSC/python-template/pull/609)
2325
* next_steps.md is shown as a copier message [#609](https://github.com/NLeSC/python-template/pull/609)

copier/messages.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,19 @@ _message_after_copy: |
2222
git add --all
2323
git commit -m "first commit"
2424
git branch -M main
25-
git remote add origin {{ repository }}
25+
git remote add origin {{ repository }}.git
2626
2727
- Push the initial commit to a new repo on GitHub
2828
2929
Go to https://github.com/organizations/{{github_organization}}/repositories/new
3030
and create a new repository named `{{ package_name }}` as an empty repository, then push your commits to GitHub:
3131
3232
git push --set-upstream origin main
33-
34-
{% if AddDevDoc -%}
33+
{% if AddDevDoc %}
3534
- Project development documentation
3635
3736
The README.dev.md contains developer documentation
38-
{%- endif %}
39-
37+
{% endif %}
4038
- Project layout explained
4139
4240
For an explanation of what files are there, and what each of these do, please refer to {{ _copier_conf.dst_path }}/project_setup.md

copier/questions/features_code_quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SelectCodeQualityFeatures:
1414
help: Select code quality features
1515
multiselect: true
1616
choices:
17-
GitHub Actions:
17+
GitHub Actions (selection on the next menu):
1818
value: SelectGitHubActions_flag
1919
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
2020
Linting:

copier/questions/features_community.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ AddCodeConduct:
2626
type: bool
2727
default: "{{ 'AddCodeConduct_flag' in SelectCommunityFeatures }}"
2828
when: false
29-
3029
AddContributing:
3130
type: bool
3231
default: "{{ 'AddContributing_flag' in SelectCommunityFeatures }}"

copier/questions/features_documentation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ AddOnlineDocumentation:
2626
type: bool
2727
default: "{{ 'AddOnlineDocumentation_flag' in SelectDocumentationFeatures }}"
2828
when: false
29-
3029
AddDevDoc:
3130
type: bool
3231
default: "{{ 'AddDevDoc_flag' in SelectDocumentationFeatures }}"

copier/questions/features_publish_release.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SelectPublishReleaseFeatures:
1414
help: Select publish and release features
1515
multiselect: true
1616
choices:
17-
Citation:
17+
Citation (selection on the next menu):
1818
value: SelectCitation_flag
1919
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
2020
Changelog:
@@ -23,10 +23,6 @@ SelectPublishReleaseFeatures:
2323
Zenodo integration instructions:
2424
value: AddZenodo_flag
2525
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
26-
Package keywords(NOT_IMPLEMENTED):
27-
value: not_implemented_keywords
28-
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
29-
3026

3127
# Sub-menus
3228
# split AddCitation --> enable_citation_file and enable_cffconvert
@@ -55,17 +51,14 @@ AddCitation:
5551
type: bool
5652
default: "{{ 'AddCitationFile_flag' in SelectCitation }}"
5753
when: false
58-
5954
AddCFFConvert:
6055
type: bool
6156
default: "{{ 'AddCFFConvert_flag' in SelectCitation }}"
6257
when: false
63-
6458
AddChangeLog:
6559
type: bool
6660
default: "{{ 'AddChangeLog_flag' in SelectPublishReleaseFeatures }}"
6761
when: false
68-
6962
AddZenodo:
7063
type: bool
7164
default: "{{ 'AddZenodo_flag' in SelectPublishReleaseFeatures }}"
Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,36 @@
11
---
22
# package details
3-
AddPackageDetails:
4-
type: bool
5-
default: yes
6-
help: |-
7-
If you are planning to publish the package it is recommended to provide more details.
8-
Do you want to provide extra details for the package?
9-
when: "{{ template_profile != 'minimum'}}"
3+
# AddPackageDetails:
4+
# type: bool
5+
# default: yes
6+
# help: |-
7+
# If you are planning to publish the package it is recommended to provide more details.
8+
# Do you want to provide extra details for the package?
9+
# when: false
1010
package_short_description:
1111
type: str
1212
placeholder: Short description
1313
help: Short description of package
14-
when: "{{ template_profile != 'minimum' and AddPackageDetails }}"
1514
validator: >-
1615
{% if not package_short_description %}
1716
Package description cannot be empty
1817
{% endif %}
19-
keyword1:
18+
keywords:
2019
type: str
21-
placeholder: keyword1
22-
help: Add keyword1
23-
when: "{{ template_profile != 'minimum' and AddPackageDetails }}"
24-
keyword2:
25-
type: str
26-
placeholder: keyword2
27-
help: Add keyword2
28-
when: "{{ template_profile != 'minimum' and AddPackageDetails }}"
20+
placeholder: keyword1,second keyword,third keyword
21+
help: Add keywords to make your package findable on PyPI
2922
github_organization:
3023
type: str
31-
placeholder: "<my-github-organization>"
24+
placeholder: "your-github-username or your-github-organization"
3225
help: Enter the name of your GitHub username or organization
33-
when: "{{ template_profile != 'minimum' and AddPackageDetails }}"
3426
validator: >-
35-
{% if not github_organization %}
36-
This field cannot be empty
27+
{% if not (github_organization | regex_search('^\\S*$')) %}
28+
Username or organization cannot include spaces
3729
{% endif %}
3830
email:
3931
type: str
4032
placeholder: yourname@esciencecenter.nl
4133
help: What is your email address?
42-
when: "{{ template_profile != 'minimum' and AddPackageDetails }}"
4334
validator: >-
4435
{% if not (email | regex_search('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')) %}
4536
Please enter a valid email address
@@ -48,22 +39,24 @@ code_of_conduct_email:
4839
type: str
4940
default: "{{ email }}"
5041
help: What is the email address to report code of conduct violations?
51-
when: "{{ template_profile != 'minimum' and AddPackageDetails }}"
5242
validator: >-
5343
{% 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,})+')) %}
5444
Please enter a valid email address
5545
{% endif %}
5646
copyright_holder:
5747
type: str
58-
placeholder: Netherlands eScience Center
59-
help: Who is the copyright holder?
60-
when: "{{ template_profile != 'minimum' and AddPackageDetails }}"
48+
default: "{{ full_name }}"
49+
help: Who is the copyright holder (the default is your full name)?
50+
validator: >-
51+
{% if not copyright_holder %}
52+
This field cannot be empty as it will be used in content of the generated files.
53+
{% endif %}
6154
62-
# calculated fields for GitHub
55+
56+
# computed fields
6357
repository:
6458
default: git@github.com:{{ github_organization }}/{{ package_name }}
6559
when: false
66-
6760
repository_url:
6861
default: https://github.com/{{ github_organization }}/{{ package_name }}
6962
when: false

copier/settings.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ _skip_if_exists:
66
- "pyproject.toml"
77
- CITATION.cff
88
- LICENSE
9+
- CHANGELOG.md
10+
- CODE_OF_CONDUCT.md

template/pyproject.toml.jinja

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ classifiers = [
3131
dependencies = []
3232
description = "{{ package_short_description|replace('\"', '\\\"') }}"
3333
keywords = [
34-
"{{ keyword1 }}",
35-
"{{ keyword2 }}",
34+
{%- for item in keywords.split(',') -%}
35+
"{{ item }}"{{ "," if not loop.last }}
36+
{%- endfor -%}
3637
]
3738
license = {file = "LICENSE"}
3839
name = "{{ package_name }}"
@@ -71,8 +72,10 @@ Repository = "{{ repository_url }}"
7172
Issues = "{{ repository_url }}/issues"
7273
{% if AddChangeLog -%}
7374
Changelog = "{{ repository_url }}/CHANGELOG.md"
74-
{%- endif %}
75-
75+
{% endif -%}
76+
{% if AddOnlineDocumentation -%}
77+
ReadTheDocs = "https://{{ package_name }}.readthedocs.io"
78+
{% endif %}
7679
[tool.pytest.ini_options]
7780
testpaths = ["tests"]
7881

template/{% if AddCitation %}CITATION.cff{% endif %}.jinja

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ doi: <insert your DOI here>
1212
version: "{{ version }}"
1313
repository-code: "{{ repository_url }}"
1414
keywords:
15-
- {{ keyword1 }}
16-
- {{ keyword2 }}
15+
{%- for item in keywords.split(',') %}
16+
- "{{ item }}"
17+
{%- endfor %}
1718
message: "If you use this software, please cite it using these metadata."
1819
{{ { "Apache Software License 2.0": "license: Apache-2.0",
1920
"MIT license": "license: MIT",

0 commit comments

Comments
 (0)