Skip to content

Commit d22e516

Browse files
committed
Merge branch 'main' into 465-contributing
2 parents 8bbfa2c + eae8aae commit d22e516

15 files changed

Lines changed: 291 additions & 175 deletions

CHANGELOG.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
# Change Log
22

3-
## Unreleased
3+
## [Unreleased]
44

55
### Added
66
* Make contributing guidelines optional [#465]()
7+
* Make Code of Conduct optional [#464](https://github.com/NLeSC/python-template/pull/530)
8+
* New YAML files for copier questions [#529](https://github.com/NLeSC/python-template/pull/529)
79
* Make zenodo next step instructions optional [#520](https://github.com/NLeSC/python-template/pull/520)
810
* Make SonarCloud optional [#515](https://github.com/NLeSC/python-template/pull/515)
911
* Make citation optional [#471](https://github.com/NLeSC/python-template/pull/471)
1012
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
13+
14+
### Changed
15+
16+
* pre-commit script is optional ([#457](https://github.com/NLeSC/python-template/issues/457))
17+
* CHANGELOG.md is now optional ([#462](https://github.com/NLeSC/python-template/issues/462))
18+
19+
### Removed
20+
21+
*
22+
23+
## [0.5.0]
24+
25+
Released on August 15, 2024
26+
27+
### Added
28+
1129
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)
1230
* Template unit tests for documentation generation, linting and version bumping
1331
* Docstring for function
@@ -17,6 +35,7 @@
1735

1836
### Changed
1937

38+
* Made copier configuration more modular [#529](https://github.com/NLeSC/python-template/pull/529)
2039
* pre-commit script is optional ([#457](https://github.com/NLeSC/python-template/issues/457))
2140
* CHANGELOG.md is now optional ([#462](https://github.com/NLeSC/python-template/issues/462))
2241
* Moved to src/ based layout for generated packages
@@ -44,7 +63,9 @@
4463
* Statements in project_setup.md already mentioned in README.dev.md
4564
* .zenodo.json is no longer necessary, CITATION.cff also works with Zenodo.
4665

47-
## 0.4.0
66+
## [0.4.0]
67+
68+
Released on May 3, 2021
4869

4970
### Added
5071

@@ -74,7 +95,9 @@
7495

7596
* Automatic publish to PyPi after GitHub release [#196](https://github.com/NLeSC/python-template/issues/196)
7697

77-
## 0.3.0
98+
## [0.3.0]
99+
100+
Released on Apr 22, 2021
78101

79102
### Added
80103

@@ -105,14 +128,15 @@
105128
* Updated Code of Conduct for generated package
106129
* Improved the documentation for the generated package and template itself
107130

108-
## Removed
131+
### Removed
132+
109133
* Dropped appveyor [#160](https://github.com/NLeSC/python-template/issues/160)
110134
* Dropped everything Conda related
111135
* Drop Python 3.5 support
112136
* Removed unit tests doing the linting
113137

114138

115-
## 0.2.0
139+
## [0.2.0]
116140

117141
Released on July 17, 2019
118142

@@ -150,7 +174,7 @@ Released on July 17, 2019
150174

151175
* Python 2 support
152176

153-
## 0.1.0
177+
## [0.1.0]
154178

155179
Released on July 12, 2018.
156180

@@ -170,3 +194,11 @@ Released on July 12, 2018.
170194
- README
171195
- Requirements.txt
172196
- Setup configuration
197+
198+
199+
[Unreleased]: https://github.com/NLeSC/python-template//compare/0.5.0...HEAD
200+
[0.5.0]: https://github.com/NLeSC/python-template/releases/tag/0.5.0
201+
[0.4.0]: https://github.com/NLeSC/python-template/releases/tag/0.4.0
202+
[0.3.0]: https://github.com/NLeSC/python-template/releases/tag/0.3.0
203+
[0.2.0]: https://github.com/NLeSC/python-template/releases/tag/0.2.0
204+
[0.1.0]: https://github.com/NLeSC/python-template/releases/tag/0.1.0

copier.yml

Lines changed: 18 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,159 +1,23 @@
1-
# Essential questions
1+
---
2+
# General settings for copier
3+
!include copier/settings.yml
24

3-
package_name:
4-
type: str
5-
default: my_python_package
6-
help: Enter the name of the Python package.
7-
validator: >-
8-
{% if not (package_name | regex_search('^[a-z][a-z0-9\_]+$')) %}
9-
package_name must start with a letter, followed one or more letters, digits or underscores all lowercase.
10-
{% endif %}
11-
package_short_description:
12-
type: str
13-
default: Short description of package
14-
keyword1:
15-
type: str
16-
default: keyword1
17-
keyword2:
18-
type: str
19-
default: keyword2
20-
version:
21-
type: str
22-
default: 0.1.0
23-
github_organization:
24-
type: str
25-
default: "<my-github-organization>"
26-
help: Enter the name of your GitHub username or organization
27-
full_name:
28-
type: str
29-
default: Jane Smith
30-
help: Enter your full name.
31-
email:
32-
type: str
33-
default: yourname@esciencecenter.nl
34-
copyright_holder:
35-
type: str
36-
default: Netherlands eScience Center
37-
code_of_conduct_email:
38-
type: str
39-
default: "{{ email }}"
5+
---
6+
# profiles
7+
!include copier/profiles.yml
408

41-
# calculated fields
42-
repository:
43-
default: git@github.com:{{ github_organization }}/{{ package_name }}
44-
when: false
9+
---
10+
# essential questions about the package details
11+
!include copier/questions/essential.yml
4512

46-
repository_url:
47-
default: https://github.com/{{ github_organization }}/{{ package_name }}
48-
when: false
13+
---
14+
# additional questions about the package details
15+
!include copier/questions/package_details.yml
4916

17+
---
18+
# Features
19+
!include copier/questions/features.yml
5020

51-
# profile selection
52-
template_profile:
53-
type: str
54-
default: recommended
55-
help: Optional questions (You can use our defaults, or the bare minimum, or decide everything)
56-
choices:
57-
Recommended (our defaults for research software): "recommended"
58-
Minimum (no extra features): "minimum"
59-
Let me choose (decide each feature yourself): "ask"
60-
61-
62-
# extra questions
63-
license:
64-
type: str
65-
choices:
66-
- "Apache Software License 2.0"
67-
- "MIT license"
68-
- "BSD license"
69-
- "ISC license"
70-
- "GNU General Public License v3 or later"
71-
- "GNU Lesser General Public License v3 or later"
72-
- "Not open source"
73-
default: "MIT license"
74-
75-
AddLinkCheck:
76-
when: "{{ template_profile == 'ask' }}"
77-
type: bool
78-
default: "{{ template_profile != 'minimum' }}"
79-
help: Do you want to add a GitHub action to check broken links?
80-
81-
AddGitHubActions:
82-
when: "{{ template_profile == 'ask' }}"
83-
type: bool
84-
default: "{{ template_profile != 'minimum' }}"
85-
help: GitHub actions to test the package and the documentation
86-
87-
AddCitation:
88-
when: "{{ template_profile == 'ask' }}"
89-
type: bool
90-
default: "{{ template_profile != 'minimum' }}"
91-
help: Citation file and cffconvert workflow which validates the citation file
92-
93-
AddChangeLog:
94-
when: "{{ template_profile == 'ask' }}"
95-
type: bool
96-
default: "{{ template_profile != 'minimum' }}"
97-
help: Add a change log to keep track of changes in the package
98-
99-
AddOnlineDocumentation:
100-
when: "{{ template_profile == 'ask' }}"
101-
type: bool
102-
default: "{{ template_profile != 'minimum' }}"
103-
help: Online documentation using Read the Docs
104-
105-
AddPreCommit:
106-
when: "{{ template_profile == 'ask' }}"
107-
type: bool
108-
default: "{{ template_profile != 'minimum' }}"
109-
help: Add pre-commit hook to check code style and format on every commit?
110-
111-
AddZenodo:
112-
when: "{{ template_profile == 'ask' }}"
113-
type: bool
114-
default: "{{ template_profile != 'minimum' }}"
115-
help: Create a GitHub issue on how to enable Zenodo integration?
116-
117-
AddSonarCloud:
118-
when: "{{ template_profile == 'ask' }}"
119-
type: bool
120-
default: "{{ template_profile != 'minimum' }}"
121-
help: Add SonarCloud (code analysis service) integration?
122-
123-
AddContributing:
124-
when: "{{ template_profile == 'ask' }}"
125-
type: bool
126-
default: "{{ template_profile != 'minimum' }}"
127-
help: Add contributing guidelines?
128-
129-
# internal fields
130-
_subdirectory: template
131-
132-
# user messages
133-
_message_before_copy: |
134-
Thanks for generating a project using our template.
135-
136-
You'll be asked a series of questions whose answers will be used to
137-
generate a tailored project for you.
138-
139-
_message_after_copy: |
140-
Your project "{{ package_name }}" has been created successfully!
141-
142-
Next steps:
143-
144-
1. Change directory to the project root:
145-
146-
$ cd {{ _copier_conf.dst_path }}
147-
148-
2. Read next_steps.md which contains information on next steps.
149-
150-
_message_before_update: |
151-
Thanks for updating your project using our template.
152-
153-
You'll be asked a series of questions whose answers are pre-populated
154-
with previously entered values. Feel free to change them as needed.
155-
156-
_message_after_update: |
157-
Your project "{{ package_name }}" has been updated successfully!
158-
In case there are any conflicts, please resolve them. Then,
159-
you're done.
21+
---
22+
# User messages
23+
!include copier/messages.yml

copier/messages.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# user messages
2+
_message_before_copy: |
3+
Thanks for generating a project using our template.
4+
5+
You'll be asked a series of questions whose answers will be used to
6+
generate a tailored project for you.
7+
8+
For each question there is a placeholder. Make sure you provide an
9+
input to each of them.
10+
11+
_message_after_copy: |
12+
Your project "{{ package_name }}" has been created successfully!
13+
14+
Next steps:
15+
16+
1. Change directory to the project root:
17+
18+
$ cd {{ _copier_conf.dst_path }}
19+
20+
2. Read next_steps.md which contains information on next steps.
21+
22+
_message_before_update: |
23+
Thanks for updating your project using our template.
24+
25+
You'll be asked a series of questions whose answers are pre-populated
26+
with previously entered values. Feel free to change them as needed.
27+
28+
_message_after_update: |
29+
Your project "{{ package_name }}" has been updated successfully!
30+
In case there are any conflicts, please resolve them. Then,
31+
you're done.

copier/profiles.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# profile selection
3+
template_profile:
4+
type: str
5+
default: ask
6+
help: Select a profile
7+
choices:
8+
Recommended (our defaults for research software): "recommended"
9+
Minimum (bare minimum, no extra features): "minimum"
10+
Let me choose (decide each feature yourself): "ask"

copier/questions/essential.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# Essential questions
3+
package_name:
4+
type: str
5+
placeholder: my_python_package
6+
help: Enter the name of the Python package.
7+
validator: >-
8+
{% if not (package_name | regex_search('^[a-z][a-z0-9\_]+$')) %}
9+
Package name must start with a letter, followed one or more letters, digits or underscores all lowercase
10+
{% endif %}
11+
version:
12+
type: str
13+
placeholder: 0.1.0
14+
help: Enter the version of the Python package
15+
license:
16+
type: str
17+
choices:
18+
- "Apache Software License 2.0"
19+
- "MIT license"
20+
- "BSD license"
21+
- "ISC license"
22+
- "GNU General Public License v3 or later"
23+
- "GNU Lesser General Public License v3 or later"
24+
- "Not open source"
25+
default: "Apache Software License 2.0"

0 commit comments

Comments
 (0)