Skip to content

Commit c56305a

Browse files
lyashevskasjvrijn
andcommitted
Migrate from cookiecutter to copier
This migrates from cookiecutter template to copier while keeping all original features. Closes #348 Co-authored-by: Olga Lyashevska <[email protected]> Co-authored-by: Sander van Rijn <[email protected]>
1 parent 780e6a4 commit c56305a

File tree

65 files changed

+888
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+888
-642
lines changed

{{cookiecutter.directory_name}}/docs/_templates/.gitignore renamed to .copier-answers.yml

File renamed without changes.

.github/ISSUE_TEMPLATE/10_generated_package.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
---
23
name: Related to the generated package
34
about: Related to the generated package, as opposed to the template itself.
@@ -7,5 +8,5 @@ assignees: ''
78

89
---
910
<!--
10-
Whatever you write here must have something to do with the code you get from running `cookiecutter`.
11+
Whatever you write here must have something to do with the code you get from running `copier`.
1112
-->

.github/ISSUE_TEMPLATE/20_template.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<<<<< HEAD
12
---
23
name: Related to the template itself
34
about: Related to the template itself, as opposed to the generated package.
@@ -7,5 +8,19 @@ assignees: ''
78

89
---
910
<!--
10-
Whatever you write here must have something to do with the code of the template itself, i.e. before you run `cookiecutter`.
11+
Whatever you write here must have something to do with the code of the template itself, i.e. before you run `copier`.
1112
-->
13+
||||||| empty tree
14+
=======
15+
---
16+
name: Related to the template itself
17+
about: Related to the template itself, as opposed to the generated package.
18+
title: ''
19+
labels: template
20+
assignees: ''
21+
22+
---
23+
<!--
24+
Whatever you write here must have something to do with the code of the template itself, i.e. before you run `copier`.
25+
-->
26+
>>>>>>> copier/main

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ env
2626
env3
2727
venv
2828
venv3
29+
30+
.swp
31+
.orig

CHANGELOG.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,172 @@
105105
* Removed unit tests doing the linting
106106

107107

108+
## 0.2.0
109+
110+
Released on July 17, 2019
111+
112+
### Added
113+
114+
* Set up logging and provide a logging example (#9)
115+
* Fix for displaying wide tables in the documentation (#37)
116+
* Single source version number (+ documentation) (#29)
117+
* Cookiecutter tests (#15)
118+
* Linter test for the generated project
119+
* CITATION.cff
120+
* Support for pypi deployment using travis (#36)
121+
122+
### Changed
123+
124+
* Replace dashes and spaces in project_slug with underscore (#33)
125+
* Put project setup documentation in a separate document (#39)
126+
* Fix numbered lists in .rst files (#40)
127+
* Added rst, y(a)ml and cwl to .editorconfig (#35)
128+
* Default documentation theme is `sphinx_rtd_theme` (#34)
129+
* Improve licensing
130+
* Fix example tests that failed to run (#28)
131+
* Remove quotes from project name and project description (#27)
132+
* Update prospector configuration (#26)
133+
- Make prospector less strict
134+
- Have prospector ignore the docs directory
135+
* Add `install_requires` to `setup.py` (#21)
136+
* Improved .gitignore (#22)
137+
* More detailed documentation about
138+
- Project setup
139+
- Setup instructions
140+
- NOTICE file
141+
142+
### Removed
143+
144+
* Python 2 support
145+
146+
## 0.1.0
147+
148+
Released on July 12, 2018.
149+
150+
### Added
151+
152+
* First version of the Python project template that follows the Netherlands eScience Center software development guide, containing:
153+
- Tests,
154+
- Documentation,
155+
- Code style checking
156+
- Editorconfig
157+
- Default Travis configuration
158+
- Change log
159+
- Code of Conduct
160+
- Contributing guidelines
161+
- License
162+
- Manifest.in
163+
- README
164+
- Requirements.txt
165+
- Setup configuration
166+
||||||| empty tree
167+
=======
168+
# Change Log
169+
170+
## Unreleased
171+
172+
### Added
173+
174+
* Added Python 3.12 support [#356](https://github.com/NLeSC/python-template/issues/356)
175+
* Template unit tests for documentation generation, linting and version bumping
176+
* Docstring for function
177+
* Intersphinx to documentation
178+
* Coverage and doctest commands for documentation [#97](https://github.com/NLeSC/python-template/issues/97)
179+
180+
### Changed
181+
182+
* Moved to src/ based layout for generated packages
183+
* Moved from setup.cfg/.py to pyproject.toml [#351](https://github.com/NLeSC/python-template/issues/351)
184+
* Moved from prospector to ruff [#336](https://github.com/NLeSC/python-template/issues/336)
185+
* Renamed `project_name` to `directory_name` in cookiecutter questionnaire
186+
* Initial linting is error free [#227](https://github.com/NLeSC/python-template/issues/227)
187+
* Consolidated test/lint/build/docs into single matrix workflow [#270](https://github.com/NLeSC/python-template/issues/276)
188+
* Enforce isort configuration
189+
* Default for `package_short_description` in cookiecutter questionnaire
190+
* Link checker ignores GH private pages and test pypi site [#288](https://github.com/NLeSC/python-template/issues/288)
191+
* In CI build workflow make prospector die if there are errors [#275](https://github.com/NLeSC/python-template/issues/275)
192+
* All example tests make use of example function
193+
* Use bumpversion for version in Sphinx config [#44](https://github.com/NLeSC/python-template/issues/44)
194+
* Regenerated docs/conf.py with sphinx-quickstart v3.5.4 + enabled built-in extensions [#44](https://github.com/NLeSC/python-template/issues/44)
195+
* Generate api rst files with extension instead of custom function [#95](https://github.com/NLeSC/python-template/issues/95)
196+
* Change from bump2version (unmaintained) to bump-my-version.
197+
198+
### Removed
199+
200+
* Removed Python 3.7 support [#343](https://github.com/NLeSC/python-template/issues/343)
201+
* `.pylintrc` file, was too strict, too soon [#267](https://github.com/NLeSC/python-template/issues/267)
202+
* Unused development dependencies [#167](https://github.com/NLeSC/python-template/issues/167)
203+
* Statements in project_setup.md already mentioned in README.dev.md
204+
* .zenodo.json is no longer necessary, CITATION.cff also works with Zenodo.
205+
206+
## 0.4.0
207+
208+
### Added
209+
210+
* Instructions to add your existing code to directory generated by the NLeSC Python template [#202](https://github.com/NLeSC/python-template/issues/202)
211+
* Keywords to questionnaire [#270](https://github.com/NLeSC/python-template/issues/270)
212+
* Next step issue generation workflow [#228](https://github.com/NLeSC/python-template/issues/228)
213+
* Next step issue for SonarCloud integration [#234](https://github.com/NLeSC/python-template/issues/234)
214+
* Next step issue for Zenodo integration [#235](https://github.com/NLeSC/python-template/issues/235)
215+
* Next step issue for Read the Docs [#236](https://github.com/NLeSC/python-template/issues/236)
216+
* Next step issue for citation data [#237](https://github.com/NLeSC/python-template/issues/237)
217+
* Next step issue for linting [#238](https://github.com/NLeSC/python-template/issues/238)
218+
* Next steps documentation [#240](https://github.com/NLeSC/python-template/issues/240)
219+
* Support for sub packages in distro [#160](https://github.com/NLeSC/python-template/issues/160)
220+
* Tests for api doc generation [#213](https://github.com/NLeSC/python-template/issues/213)
221+
* CI Tests on Windows [#140](https://github.com/NLeSC/python-template/issues/140) [#223](https://github.com/NLeSC/python-template/issues/223)
222+
* `.pylintrc` file
223+
* Valid license name and first author name in `CITATION.cff`
224+
* SonarCloud integration for code quality and coverage [#89](https://github.com/NLeSC/python-template/issues/89)
225+
* Read the Docs [#78](https://github.com/NLeSC/python-template/issues/78)
226+
227+
### Changed
228+
229+
* Always generate API docs [#176](https://github.com/NLeSC/python-template/issues/176)
230+
* Have 100% test coverage in generated code [#88](https://github.com/NLeSC/python-template/issues/88)
231+
232+
### Removed
233+
234+
* Automatic publish to PyPi after GitHub release [#196](https://github.com/NLeSC/python-template/issues/196)
235+
236+
## 0.3.0
237+
238+
### Added
239+
240+
* Added Python 3.9 support
241+
* Template is being tested for Python 3.6, 3.7, 3.8, 3.9
242+
* Added extra badges such as fair-software.eu badges and SonarCloud, GitHub Actions [#52](https://github.com/NLeSC/python-template/issues/52) [#57](https://github.com/NLeSC/python-template/issues/57)
243+
* Added issue templates [#159](https://github.com/NLeSC/python-template/issues/159)
244+
* Added cffconvert GitHub action [#91](https://github.com/NLeSC/python-template/issues/91)
245+
* Added Markdown Link Checker GitHub action
246+
* Added Developer documentation
247+
* Added cookiecutter post-hook to point to document with more information
248+
* Migrated to static setup.cfg as per the recommended practice [#84](https://github.com/NLeSC/python-template/issues/84)
249+
* Added Pre-commit githook to automatically run the linters before committing to GitHub [#82](https://github.com/NLeSC/python-template/issues/82)
250+
* Added Sonarcloud integration for static analysis and code coverage [#172](https://github.com/NLeSC/python-template/issues/172)
251+
* Added badges to the generated package
252+
253+
### Changed
254+
255+
* Moved requirements.txt dependencies to setup.cfg and removed requirements.txt [#67](https://github.com/NLeSC/python-template/issues/67)
256+
* Replaced all ReStructuredText (rst) files by Markdown [#190](https://github.com/NLeSC/python-template/issues/190) [#162](https://github.com/NLeSC/python-template/issues/162)
257+
* Use matrix build for generated project to support all current Python versions on Windows, Linux, Mac [#160](https://github.com/NLeSC/python-template/issues/160)
258+
* Updated CITATION.cff, .zenodo.json; removed codemeta.json [#127](https://github.com/NLeSC/python-template/issues/127) [#137](https://github.com/NLeSC/python-template/issues/137)
259+
* Updated Code of Conduct of the template
260+
* Simplified templating variables using cookiecutter pre-hook [#82](https://github.com/NLeSC/python-template/issues/82)
261+
* Consolidated pytest.ini into setup.cfg [#155](https://github.com/NLeSC/python-template/issues/155)
262+
* Versioning now handled with bump2version [#192](https://github.com/NLeSC/python-template/issues/192)
263+
* Updated project_setup.md [#165](https://github.com/NLeSC/python-template/issues/165)
264+
* Updated Code of Conduct for generated package
265+
* Improved the documentation for the generated package and template itself
266+
267+
## Removed
268+
* Dropped appveyor [#160](https://github.com/NLeSC/python-template/issues/160)
269+
* Dropped everything Conda related
270+
* Drop Python 3.5 support
271+
* Removed unit tests doing the linting
272+
273+
108274
## 0.2.0
109275

110276
Released on July 17, 2019

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ cff-version: "1.2.0"
7272
date-released: 2018-07-17
7373
doi: 10.5281/zenodo.1310751
7474
keywords:
75-
- cookiecutter
75+
- copier
7676
- template
7777
- Python
7878
license: Apache-2.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
APPENDIX: How to apply the Apache License to your work.
179179

180180
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "{}"
181+
boilerplate notice, with the fields enclosed by brackets "[]"
182182
replaced with your own identifying information. (Don't include
183183
the brackets!) The text should be enclosed in the appropriate
184184
comment syntax for the file format. We also recommend that a

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Netherlands eScience Center Python Template
22

3+
|[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)
4+
35
Spend less time setting up and configuring your new Python packages and comply with the
46
[Netherlands eScience Center Software Development Guide](https://guide.esciencecenter.nl/)
57
from the start.
@@ -162,3 +164,12 @@ list below:
162164
## How to contribute
163165

164166
Suggestions/improvements/edits are most welcome. Please read the [contribution guidelines](CONTRIBUTING.md) before creating an issue or a pull request.
167+
168+
169+
170+
171+
<!-- To generate a project from the template:
172+
```
173+
pip install copier
174+
copier copy path/to/project/template path/to/destination
175+
``` -->

cookiecutter.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

copier.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Essential questions
2+
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+
# validator: >-
15+
# {% if '"' in package_short_description %}
16+
# package_short_description must not contain unescaped double quotes. Use \\" for double quotes.
17+
# {% endif %}
18+
keyword1:
19+
type: str
20+
default: keyword1
21+
keyword2:
22+
type: str
23+
default: keyword2
24+
version:
25+
type: str
26+
default: 0.1.0
27+
github_organization:
28+
type: str
29+
default: "<my-github-organization>"
30+
license:
31+
type: str
32+
choices:
33+
- "Apache Software License 2.0"
34+
- "MIT license"
35+
- "BSD license"
36+
- "ISC license"
37+
- "GNU General Public License v3 or later"
38+
- "GNU Lesser General Public License v3 or later"
39+
- "Not open source"
40+
default: "MIT license"
41+
full_name:
42+
type: str
43+
default: Jane Smith
44+
help: Enter your full name.
45+
# validator: >-
46+
# {% if '"' in full_name %}
47+
# full_name must not contain unescaped double quotes. Use \\" for double quotes.
48+
# {% endif %}
49+
email:
50+
type: str
51+
52+
copyright_holder:
53+
type: str
54+
default: Netherlands eScience Center
55+
code_of_conduct_email:
56+
type: str
57+
default: "{{ email }}"
58+
59+
_subdirectory: template
60+
61+
repository:
62+
default: [email protected]:{{ github_organization }}/{{ directory_name }}
63+
when: false
64+
65+
repository_url:
66+
default: https://github.com/{{ github_organization }}/{{ directory_name }}
67+
when: false
68+
69+
70+
# Optional questions

0 commit comments

Comments
 (0)