-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yml
More file actions
192 lines (163 loc) · 3.93 KB
/
Copy pathcopier.yml
File metadata and controls
192 lines (163 loc) · 3.93 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
# questions
## metadata
project_name:
type: str
help: An awesome project needs an awesome name. Tell me yours.
validator: >-
{% if not (project_name | regex_search('^[a-z][a-z0-9\-]+$')) %}
project_name must start with a letter, followed one or more letters, digits or dashes all lowercase.
{% endif %}
project_snake:
type: str
help: Project name in snake_case.
# validator: >-
# {% if not (project_name | regex_search('^[a-z][a-z0-9\_]+$')) %}
# project_snake must start with a letter, followed one or more letters, digits or underscores all lowercase.
# {% endif %}
default: "{% include pathjoin('includes', 'project-snake.jinja') %}"
author_name:
type: str
help: Who's the author?
placeholder: nameuser
validator: >-
{% if author_name == '' %}
Must provide an author.
{% endif %}
placeholder: Your Name
author_email:
type: str
help: What's the author's email?
placeholder: nameuser@company.com
validator: >-
{% if author_email == '' %}
Must provide an email.
{% endif %}
placeholder: your@name.com
description:
type: str
help: Short project description.
minimum_python_version:
type: str
help: Minimum Python version you want to support.
default: "3.12"
maximum_python_version:
type: str
help: Maximum Python version you want to support.
default: ""
license:
type: str
help: Project license
## structure
structure:
type: str
help: How do you want to structure your project?
choices:
polylith: poly
src: src
simple: simple
## package manager
package_manager:
type: str
help: Which package manager do you want to use?
choices:
uv: uv
pdm: pdm
poetry: poetry
default: uv
## dev tools
commitizen:
type: bool
help: Set up commitizen?
default: true
cz_gitmoji:
type: bool
help: Set up cz gitmoji?
default: "{% if commitizen %}true{% else %}false{% endif %}"
when: "{{ commitizen }}"
pytest:
type: bool
help: Set up pytest?
default: true
coverage:
type: bool
help: Set up coverage?
default: "{% if pytest %}true{% else %}false{% endif %}"
when: "{{ pytest }}"
ruff:
type: bool
help: Set up ruff?
default: true
mypy:
type: bool
help: Set up mypy?
default: true
pre_commit:
type: bool
help: Set up pre-commit?
default: true
## other dependencies
loguru:
type: bool
help: Add loguru?
default: true
sqlalchemy:
type: bool
help: Add sqlalchemy?
default: false
alembic:
type: bool
help: Set up alembic?
default: false
when: "{{ sqlalchemy }}"
web_app:
type: bool
help: Writing a web app?
default: false
web_app_lib:
type: str
help: Which library?
choices:
litestar: litestar
fastapi: fastapi
default: litestar
when: "{{ web_app }}"
## CI
ci:
type: bool
help: Do you want to set up a CI provider?
default: true
ci_provider:
type: str
help: What Continuous Integration service do you want to use?
choices:
GitHub CI: github
GitLab CI: gitlab
Circle CI: circle
Forgejo Actions: forgejo
default: forgejo
when: "{{ ci }}"
###############################################################################
# settings
_subdirectory: template
_envops:
trim_blocks: true
lstrip_blocks: true
_tasks:
- "git init"
# uv
- command: uv sync
when: "{{ package_manager == 'uv' }}"
- command: uv run inv poly.create-workspace {{ project_snake }}
when: "{{ package_manager == 'uv' and structure == 'poly' }}"
- command: uv run pre-commit install --install-hooks
when: "{{ pre_commit }}"
# pdm
- command: pdm install
when: "{{ package_manager == 'pdm' }}"
- command: pdm run inv poly.create-workspace {{ project_snake }}
when: "{{ package_manager == 'pdm' and structure == 'poly' }}"
# poetry
- command: poetry install
when: "{{ package_manager == 'poetry' }}"
- command: poetry poly create workspace --name {{ project_snake }} --theme loose
when: "{{ package_manager == 'poetry' and structure == 'poly' }}"