-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopier.yaml
191 lines (162 loc) · 5.49 KB
/
copier.yaml
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
# Significant portions of this file are lifted from
# https://github.com/pawamoy/copier-pdm/blob/main/copier.yml
# ISC License
# Copyright (c) 2019, Timothée Mazzucotelli
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
################################################################################
# Configuration #
################################################################################
_min_copier_version: "9.4.0"
_envops:
autoescape: false
keep_trailing_newline: true
_subdirectory: project
_templates_suffix: .jinja
_jinja_extensions:
- copier_templates_extensions.TemplateExtensionLoader
- src/copier_hatch/extensions.py:ContextUpdater
- src/copier_hatch/extensions.py:GitExtension
- src/copier_hatch/extensions.py:PythonVersionExtension
- src/copier_hatch/extensions.py:SlugifyExtension
_tasks:
# Initialize repo if not yet initialized
- "[ -d .git ] || git init"
# Initial commit
- "{% if initial_commit %}git add .{% endif %}"
- "{% if initial_commit %}git commit -m 'chore: initial commit'{% endif %}"
# Setup pre-commit
# TODO(RR): add a ctt test case that checks for the hooks
- "{% if setup_pre_commit %}hatch run lint:install{% endif %}"
_skip_if_exists:
- "*__init__.py"
- "tests/"
################################################################################
# Prompt #
################################################################################
project_name:
type: str
help: Project name
project_description:
type: str
help: Project description
#------------------------#
# Repository Settings #
#------------------------#
repository_provider:
type: str
help: Repository provider
default: github.com
choices:
- github.com
repository_namespace:
type: str
help: Repository namespace (organization or username)
default: "{{ 'spacecoffin' | git_user_name }}"
repository_name:
type: str
help: Repository name
default: "{{ project_name | slugify('-') }}"
#------------------------#
# Naming #
#------------------------#
python_package_distribution_name:
type: str
help: Python package distribution name (for `pip install NAME`)
default: "{{ repository_name | slugify('-') }}"
python_package_import_name:
type: str
help: Python package import name (for `import NAME` in Python code)
default: "{{ repository_name | slugify('_') }}"
#------------------------#
# Python settings #
#------------------------#
minimum_python_version:
type: str
help: Minimum supported Python version
default: "3.9"
choices:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
maximum_python_version:
type: str
help: Maximum supported Python version
default: "3.13"
choices:
"3.9":
value: "3.9"
validator: >-
{% if '3.9' is version_lt(minimum_python_version) %}
Maximum Python version must be >= minimum version ({{ minimum_python_version }})
{% endif %}
"3.10":
value: "3.10"
validator: >-
{% if '3.10' is version_lt(minimum_python_version) %}
Maximum Python version must be >= minimum version ({{ minimum_python_version }})
{% endif %}
"3.11":
value: "3.11"
validator: >-
{% if '3.11' is version_lt(minimum_python_version) %}
Maximum Python version must be >= minimum version ({{ minimum_python_version }})
{% endif %}
"3.12":
value: "3.12"
validator: >-
{% if '3.12' is version_lt(minimum_python_version) %}
Maximum Python version must be >= minimum version ({{ minimum_python_version }})
{% endif %}
"3.13":
value: "3.13"
maximum_line_length:
type: int
help: Line length maximum
default: 88
validator: >-
{% if maximum_line_length < 79 %}
Line length maximum must be at least 79 characters
{% elif maximum_line_length > 120 %}
Line length maximum can be at most 120 characters
{% endif %}
#------------------------#
# Setup #
#------------------------#
initial_commit:
type: bool
help: Create an initial commit with the generated {{ python_package_import_name }}?
default: no
setup_pre_commit:
type: bool
help: Setup pre-commit hooks (requires pre-commit)?
default: no
#------------------------#
# Formalities #
#------------------------#
author_fullname:
type: str
help: Author name
default: "{{ 'Reed Rosenberg' | git_user_name }}"
author_email:
type: str
help: Author email
default: "{{ 'spacecoffin@users.noreply.github.com' | git_user_email }}"
copyright_holder:
type: str
help: The name of the person/entity holding the copyright
default: "{{ author_fullname }}"
copyright_holder_email:
type: str
help: Email of the person/entity holding the copyright
default: "{{ author_email }}"