Skip to content

Commit 076aaac

Browse files
authored
Merge branch 'main' into 575-user-profiles
2 parents e0f0131 + caf8c92 commit 076aaac

12 files changed

Lines changed: 91 additions & 65 deletions

CHANGELOG.md

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

1919
### Changed
2020
* Update the user documentation (README.md) of the template [#575](https://github.com/NLeSC/python-template/pull/623)
21+
* Updated .gitignore [#622](https://github.com/NLeSC/python-template/pull/622)
22+
* add extra info for sub-menus [#628](https://github.com/NLeSC/python-template/pull/628)
23+
* skip merging CHANGELOG.md and CODE_OF_CONDUCT.md if they exist [#628](https://github.com/NLeSC/python-template/pull/628)
2124
* added value field to license options [#617](https://github.com/NLeSC/python-template/pull/617)
2225
* fix filename typo of githooks [#611](https://github.com/NLeSC/python-template/pull/609)
2326
* 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/.gitignore

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,69 @@
1+
# Byte-compiled / optimized / DLL files
12
*.py[cod]
2-
*.egg-info
3-
*.eggs
4-
.ipynb_checkpoints
5-
6-
build
7-
dist
8-
.cache
3+
*$py.class
94
__pycache__
105

11-
htmlcov
6+
# Distribution / packaging
7+
.Python
8+
build/
9+
develop-eggs/
10+
dist/
11+
downloads/
12+
eggs/
13+
.eggs/
14+
lib/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
wheels/
20+
share/python-wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
25+
# jupyter notebook
26+
.ipynb_checkpoints
27+
28+
# Unit test / coverage reports
29+
htmlcov/
1230
.coverage
31+
.coverage.*
1332
coverage.xml
33+
.cache
1434
.pytest_cache
15-
.tox
35+
.tox/
1636

37+
# Sphinx documentation
1738
docs/_build
1839

1940
# ide
20-
.idea
21-
.eclipse
22-
.vscode
41+
# PyCharm
42+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
43+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
44+
# and can be added to the global gitignore or merged into this file. For a more nuclear
45+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
46+
#.idea/
47+
.spyderproject
48+
.spyproject
2349

2450
# Mac
2551
.DS_Store
2652

2753
# virtual environments
2854
env
55+
.env
2956
env3
57+
.env3
3058
venv
59+
.venv
3160
venv3
61+
.venv3
62+
ENV/
63+
env.bak/
64+
venv.bak/
3265

33-
.swp
66+
# vim
67+
*.swp
68+
*.swo
69+
*.orig

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

0 commit comments

Comments
 (0)