-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcopier.yml
More file actions
278 lines (252 loc) · 8.43 KB
/
Copy pathcopier.yml
File metadata and controls
278 lines (252 loc) · 8.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# yapy-copier-template
# copier.yml
#
# https://copier.readthedocs.io/en/stable/configuring/
# another one:
# https://github.com/superlinear-ai/substrate/blob/main/copier.yml
author_count:
type: int
help: How many main authors are involved?
default: 1
validator: >-
{% if author_count < 1 %}
Invalid author count, there should be at least one author.
{% endif %}
author_names:
type: str
help: Who are the main authors? A comma-separated list of full names is recommended.
placeholder: >-
{%- for n in range(author_count|int) -%}
{%- if loop.index > 1 -%}, {% endif -%}
firstName{{n}} lastName{{n}}
{%- endfor -%}
validator: >-
{% if not author_names.strip() or not author_names.replace(',','').strip() %}
Invalid author names
{% endif %}
{% if (author_names.split(",")|length) != author_count %}
The number of author names must match the given author count.
{% endif %}
author_emails:
type: str
help: What are the email addresses of the main authors? (comma separated)
default: >-
{%- for author in author_names.split(",") -%}
{%- set names = author.strip().split(" ") -%}
{%- if names|length >= 1 -%}
{{ names[0].lower() }}.{{ names[-1].lower() }}@example.com{% if not loop.last %}, {% endif %}
{%- endif -%}
{%- endfor -%}
validator: >-
{% if not author_emails.strip() or not author_emails.replace(',','').strip() %}
Invalid author email addresses
{% endif %}
{% if (author_emails.split(",")|length) != author_count %}
The number of email addresses must match the given author count.
{% endif %}
author_websites:
type: str
help: What are the websites of the main authors? (optional, comma separated)
placeholder: >-
{%- for n in range(author_count|int) -%}
{%- if loop.index > 1 %}, {% endif -%}
https://blog{{n}}.example.com
{%- endfor -%}
validator: >-
{% if author_count > 1 and
(not author_websites.strip() or not author_websites.replace(',','').strip())
%}
Invalid list of author websites
{% endif %}
{% if (author_websites.split(",")|length) != author_count %}
The number of author websites must match the given author count.
{% endif %}
{%- for website in author_websites.split(",") -%}
{% if website.strip() and
not (website.strip().startswith("https://")
or website.strip().startswith("http://"))
%}
Invalid URL: '{{website}}'
{%- endif -%}
{%- endfor -%}
project_name:
type: str
help: What is your project name?
default: My Test Project
validator: >-
{% if not project_name.strip() %}
Invalid project name
{% endif %}
repo_name:
type: str
help: Its repository name, will be part of the URL and without spaces (on github.com for example)
default: "{{ project_name|lower|replace(' ','-') }}"
validator: >-
{% if not repo_name.strip() or " " in repo_name %}
Invalid repository name
{% endif %}
package_name:
type: str
help: The Python package name (for import), lower case, must not contain spaces or dash -
default: "{{ project_name|lower|replace(' ','_')|replace('-','_') }}"
validator: >-
{% if not package_name.strip() or " " in package_name or "-" in package_name %}
Invalid package name
{% endif %}
when: false # autogenerated
distribution_name:
type: str
help: The Python distribution name (the downloadable package on PyPi)
default: "{{ package_name|replace('_','-') }}"
validator: >-
{% if not distribution_name.strip() or "_" in distribution_name %}
Invalid distribution name
{% endif %}
when: false # autogenerated
project_description:
type: str
help: What does {{ project_name }} do in one sentence?
default: An example package. Generated with *copier*.
validator: >-
{% if not project_description.strip() %}
Invalid project description
{% endif %}
repo_hosting_domain:
type: str
help: Where will the project be hosted on?
choices:
GitHub: github.com
BAM-internal Gitlab: git.bam.de
Gitlab: gitlab.com
Other service not listed:
value: custom
repo_hosting_custom:
type: str
help: Please tell me your custom repo hosting service
placeholder: your-custom-git.repo.example.com
when: "{{ repo_hosting_domain == 'custom' }}"
validator: >-
{% if not repo_hosting_custom.strip() %}
Invalid custom repo hosting service
{% endif %}
repo_hosting:
type: str
when: false # autogenerated
default: "{{ repo_hosting_domain if repo_hosting_domain != 'custom' else repo_hosting_custom }}"
repo_userorg:
type: str
help: The user or organization on the repo hosting domain
default: BAMresearch
validator: >-
{% if not repo_userorg.strip() %}
Invalid custom repo username or organization
{% endif %}
repo_main_branch:
type: str
help: The main branch name of the repository
default: main
validator: >-
{% if not repo_main_branch.strip() %}
Invalid branch name
{% endif %}
docs_url:
type: str
help: URL where the (generated) documentation can be found (optional)
default: >-
https://{{ repo_userorg }}.{{ repo_hosting|lower|replace('github.com','github.io') }}/{{ repo_name }}
validator: >-
{% if docs_url.strip() and
not (docs_url.strip().startswith("https://")
or docs_url.strip().startswith("http://"))
%}
Invalid URL: '{{docs_url}}'
{%- endif -%}
sphinx_theme:
type: str
help: Theme to use for rendering the documentation with sphinx
choices:
- furo
- sphinx-rtd-theme
- python-docs-theme
- sphinx-py3doc-enhanced-theme
- sphinx-book-theme
- pydata-sphinx-theme
release_date_question:
type: str
help: "The initial release date of the project ('today' or ISO notation: yy-mm-dd)"
default: today
validator: >- # some very basic date parsing
{%- set date = release_date_question.strip().split("-") | map('int') | list -%}
{%- if not release_date_question.strip() or (release_date_question.strip() != 'today' and
not (date.0 > 0 and date.1 > 0 and date.1 < 13 and date.2 > 0 and date.2 < 32)) -%}
Invalid release date
{% endif %}
initial_release_date:
type: str
when: false # autogenerated
help: Get the release date from the answer
default: >-
{% if release_date_question == 'today' -%}
{%- now 'utc', '%Y-%m-%d' -%}
{%- else -%}{{ release_date_question }}{%- endif %}
copyright_from:
type: int
help: Copyright from this year
default: "{% now 'utc', '%Y' %}"
validator: >-
{% if not (copyright_from > 0) %}
Invalid copyright from year
{% endif %}
copyright_to:
type: int
when: false # autogenerated
help: Copyright up to this year (the current typically)
default: "{% now 'utc', '%Y' %}"
validator: >-
{% if not copyright_to > 0 or copyright_to < copyright_from %}
Invalid copyright to year
{% endif %}
license:
type: str
help: The software license to use for your project
choices:
- BSD-2-Clause
- BSD-3-Clause
- MIT
- ISC
- Apache-2.0
- GPL-3.0-or-later
- LGPL-3.0-or-later
- no
version:
type: str
help: What is the current version of your project to start with?
default: 0.1.0
validator: >-
{% if not version.strip() %}
Invalid version
{% endif %}
python_versions:
type: str
help: Python versions to support and to test against
choices:
- 3.10
- 3.11
- 3.12
- 3.13
- 3.14
- 3.15
multiselect: true
pypi_host:
type: str
help: Which pypi host to configure?
choices:
- test.pypi.org
- pypi.org
_migrations:
- command: tox -e check
_subdirectory: "{{ '{{' }}repo_name{{ '}}' }}"
_exclude:
- test-answers-*
_jinja_extensions:
- jinja2_time.TimeExtension