-
Notifications
You must be signed in to change notification settings - Fork 0
/
copier.yml
194 lines (171 loc) · 4.52 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
_envops:
trim_blocks: true
_subdirectory: "template"
project_name:
help: "Project name"
type: "str"
placeholder: "Lorem Ipsum"
validator: >
{%- if not project_name -%}
You must provide a project name.
{%- endif -%}
project_slug:
when: false
default: "{{ project_name | lower | replace(' ', '-') | replace('_', '-') }}"
project_type:
help: "Project type"
type: "str"
choices:
- "application"
- "library"
- "virtual"
build_system:
when: "{{ project_type == 'library' }}"
help: "Build system"
type: "str"
choices:
- "hatchling"
- "maturin"
default: "hatchling"
project_description:
help: "Project description"
type: "str"
placeholder: "Lorem ipsum dolor sit amet."
validator: >
{%- if not project_description -%}
You must provide a project description.
{%- elif project_description[-1] not in ".!?…" -%}
The project description must end with a punctuation mark.
{%- endif -%}
author_name:
help: "Your full name"
type: "str"
placeholder: "John Doe"
validator: >
{%- if not author_name -%}
You must provide your full name.
{%- endif -%}
author_email:
help: "Your email"
type: "str"
placeholder: "john@doe.tld"
validator: >
{%- if not author_email | regex_search('^[^\s@]+@[^\s@]+\.[^\s@]+$') -%}
You must provide a valid email address.
{%- endif -%}
license:
help: "Project license"
type: "str"
choices:
- "MIT"
- "Proprietary"
default: "Proprietary"
copyright_holder:
help: "Name of the person or entity holding the copyright"
type: "str"
default: "{{ author_name }}"
validator: >
{%- if not copyright_holder -%}
You must provide a copyright holder.
{%- endif -%}
copyright_year:
help: "Copyright year"
type: "int"
default: 2024
validator: >
{%- if not 2020 <= copyright_year <= 2100 -%}
You must provide a valid year between 2020 and 2100.
{%- endif -%}
package_name:
when: "{{ project_type != 'virtual' }}"
help: "Python package name e.g. on PyPI (dashes are recommended over underscores)"
type: "str"
default: "{{ project_slug }}"
validator: >
{%- if not package_name | regex_search('^[a-z][a-z0-9]+([-_][a-z0-9]+)*$') -%}
You must provide a valid Python package name.
{%- endif -%}
module_name:
when: false
default: "{{ package_name | replace('-', '_') }}"
script_name:
when: "{{ project_type == 'application' }}"
help: "Python script name"
type: "str"
default: "{{ package_name }}"
validator: >
{%- if project_type == 'application' and not script_name -%}
You must provide a name for the Python script.
{%- endif -%}
doc_generator:
help: "Documentation generator"
type: "str"
choices:
- "sphinx"
- "none"
default: >
{%- if project_type == 'library' -%}
sphinx
{%- else -%}
none
{%- endif -%}
python_version:
help: "Minimum Python version"
type: "str"
default: "3.12"
validator: >
{%- if not python_version | regex_search('^3\\.\\d{1,2}$') -%}
The Python version must be in the format "3.x".
{%- endif -%}
python_version_info:
when: false
type: "json"
default: "[{{ python_version.split('.')[0] | int }}, {{ python_version.split('.')[1] | int }}]"
hosting_platform:
help: "Code hosting platform for the project"
type: "str"
choices:
- "none"
- "github"
github_account:
when: "{{ hosting_platform == 'github' }}"
help: "GitHub account (username or organization)"
type: "str"
placeholder: "jdoe"
validator: >
{%- if not github_account -%}
You must provide a GitHub account.
{%- endif -%}
repo_name:
when: "{{ hosting_platform != 'none' }}"
help: "Name of the{% if hosting_platform == 'github' %} GitHub{% endif %} repository"
type: "str"
default: >
{%- if project_type == 'application' -%}
{{ project_slug }}
{%- elif project_type == 'library' -%}
python-{{ project_slug }}
{%- elif project_type == 'virtual' -%}
{{ project_slug }}-venv
{%- endif -%}
validator: >
{%- if not repo_name -%}
You must provide a repository name.
{%- endif -%}
repo_url:
when: false
default: >
{%- if hosting_platform == 'github' -%}
https://github.com/{{ github_account }}/{{ repo_name }}
{%- endif -%}
github_pages:
when: "{{ hosting_platform == 'github' and doc_generator != 'none' }}"
help: "Enable GitHub Pages"
type: "bool"
default: "{{ hosting_platform == 'github' and doc_generator != 'none' }}"
pages_url:
when: false
default: >
{%- if github_pages -%}
https://{{ github_account }}.github.io/{{ repo_name }}
{%- endif -%}