-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopier.yml
282 lines (245 loc) · 6.93 KB
/
copier.yml
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
279
280
281
282
# CONFIGURATION -------------------------
_min_copier_version: "9.1.0" # Earliest version with "multiselect" support.
_envops:
autoescape: false
keep_trailing_newline: true
_subdirectory: project
_templates_suffix: .jinja
_skip_if_exists:
# - README.md # overwrite README.md
- LICENSE.md
- .gitignore
_message_before_copy: |
Thanks for generating a project using this template.
_message_after_copy: |
Your project "{{ project_name }}" has been created successfully!
# PROMPTS --------------------------------
custom_install:
help: Would you like to use simple (default tooling) or customized installation?
type: bool
default: customized
choices:
customized: true
simple: false
project_name:
type: str
help: What is the name of your project?
default: example-project
validator: >-
{% if not project_name %}
Project name is required.
{% elif not (project_name | regex_search('^[a-z][a-z0-9\_\-]+$')) %}
Must use a lowercase letter followed by one or more of (a-z, 0-9, _, -).
{% endif %}
project_description:
type: str
help: What is your project description?
placeholder: "A Python package that ..."
repository_provider:
type: str
help: Your Github repository provider instance domain?
default: github.com
when: "{{ custom_install }}"
ghes:
type: bool
default: "{{ repository_provider != 'github.com' }}"
when: false
primary_branch:
type: str
help: What is your primary git branch?
default: main
when: "{{ custom_install }}"
author_username:
type: str
help: What's your Github username?
validator: >-
{% if not (author_username | regex_search('^[a-zA-Z0-9][a-zA-Z0-9\-]*$')) %}
The name may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen.
{% endif %}
author_email:
type: str
help: What's the author's preferred github email address?
placeholder: "{{ author_username }}@users.noreply.{{ repository_provider }}"
validator: >-
{% if not (author_email | regex_search('^\S+@\S+\.\S+$')) %}
The email must be valid.
{% endif %}
repository_namespace:
type: str
help: What's the repository namespace?
default: "{{ author_username }}"
validator: >-
{% if not (repository_namespace | regex_search('^[a-zA-Z0-9][a-zA-Z0-9\-]*$')) %}
The name may only contain alphanumeric characters or single hyphens, and cannot begin or end with a hyphen.
{% endif %}
repository_name:
type: str
help: What's the repository name?
default: "{{ project_name|lower|replace('_', '-')|replace(' ', '-') }}"
copyright_holder:
type: str
help: The name of the person/entity holding the copyright?
default: "{{ author_username }}"
when: "{{ custom_install }}"
copyright_holder_email:
type: str
help: The email of the person/entity holding the copyright?
default: "{{ author_email }}"
when: "{{ custom_install }}"
copyright_year:
type: int
help: The copyright year?
default: 2025
when: "{{ custom_install }}"
copyright_license:
type: str
help: Which license do you want for the project?
default: MIT
choices:
MIT: MIT
GNU: GNU GPLv3
none: none
when: "{{ custom_install }}"
# https://devguide.python.org/versions/
python_version:
type: str
help: What version of python are you targeting?
default: "3.11"
choices:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
python_package_distribution_name:
type: str
help: Your Python package distribution name (for `pip install NAME`)
default: "{{ project_name|lower|replace('_', '-')|replace(' ', '-') }}"
when: "{{ custom_install }}"
python_package_import_name:
type: str
help: Your Python package import name (for `import NAME` in Python code)
default: "{{ project_name|lower|replace('-', '_')|replace(' ', '_') }}"
when: "{{ custom_install }}"
python_package_command_line_name:
type: str
help: Your CLI name if any (for use in the shell)
default: "{{ project_name|lower|replace('_', '-')|replace(' ', '-') }}"
when: "{{ custom_install }}"
line_ending:
type: str
help: Which line endings do you prefer?
default: lf
choices:
LF: lf
CLRF: crlf
use_precommit:
type: bool
default: yes
help: Do you want to use pre-commit?
choices:
yes: true
no: false
when: "{{ custom_install }}"
include_docs:
help: Do you want to include a source code documentation?
type: bool
default: yes
choices:
yes: true
no: false
when: "{{ custom_install }}"
include_notebooks:
help: Do you want to include rendered notebooks in your documentation?
type: bool
default: "{{ include_docs }}"
choices:
yes: true
no: false
when: "{{ custom_install and include_docs }}"
include_databricks:
help: Do you want to include Databricks support?
type: bool
default: false
choices:
yes: true
no: false
when: "{{ custom_install }}"
include_copilot:
help: Do you want use Github CoPilot?
type: bool
default: false
choices:
yes: true
no: false
when: "{{ custom_install }}"
github_runner_python_version:
type: str
help: Which Python versions do you want to use on your Github Runner?
default: ["{{ python_version }}"]
multiselect: true
choices:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
validator: >-
{% set python_minor = python_version|replace('3.', '')|float %}
{% set valid_list_length = github_runner_python_version|map('replace', '3.', '')|map("float")|select("ge", python_minor)|list|length%}
{% if not (valid_list_length == github_runner_python_version|length) %}
Selected values need to be greater than or equal to {{ python_version }}.
{% endif %}
github_runner:
type: str
help: Which operating systems do you want to use on your Github Runner?
default: [ubuntu-latest]
multiselect: true
choices:
Ubuntu: ubuntu-latest
Windows: windows-latest
MacOS: macos-latest
# self-hosted infra tags
SelfHosted: self-hosted
RoadRunner: road-runner
github_runner_onprem:
type: str
help: Which additional tags do you want to add to your onprem runner?
when: "{{ 'road-runner' in github_runner }}"
default: os-small-amd64-linux
choices:
Tiny: caas-tiny-amd64-linux
Small: os-small-amd64-linux
Medium: os-medium-amd64-linux
Large: os-large-amd64-linux
XL: os-xlarge-amd64-linux
github_rate_limit:
help: Do you want to prevent Github Actions rate limiting?
type: bool
default: "{{ ghes }}"
choices:
yes: true
no: false
when: "{{ custom_install and (('road-runner' in github_runner) or ('self-hosted' in github_runner)) }}"
github_action_version:
type: int
default: "{% if ghes %}3{% else %}4{% endif %}"
when: false
include_sample_code:
help: Do you want include sample code?
type: bool
default: false
choices:
yes: true
no: false
when: "{{ custom_install }}"
self_signed:
help: Do you want to bypass self signed certificates?
type: bool
default: false
choices:
yes: true
no: false
when: "{{ custom_install }}"