-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopier.yaml
147 lines (128 loc) · 3.72 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
_jinja_extensions:
- copier_templates_extensions.TemplateExtensionLoader
- extensions/context.py:DependenciesUpdater
- extensions/context.py:AuthorFromGit
- extensions/context.py:InitGitRepo
_subdirectory: "template_src"
_answers_file: .copier-answers.main.yaml
project_name:
type: str
help: What is your project name? Using plain english.
validator: >-
{% if not project_name %}
'project_name' can't be empty
{% endif %}
project_layout:
type: str
choices:
flat: "flat"
src: "src"
one_file: "one_file"
default: "flat"
help: "How would you like to layout your project? One file is a single `main.py` file. Reference: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/"
module_name:
type: str
help: What is your Python module name?
default: "{{ project_name.lower().replace(' ', '_').replace('-', '_') }}"
validator: >-
{% if not module_name %}
'module_name' can't be empty
{% endif %}
when: "{{ project_layout == 'flat' }}"
author_name:
type: str
help: What is your name? Default is the name from your git config.
default: "{{ get_author_name_from_git() }}"
validator: >-
{% if not author_name %}
'author_name' can't be empty
{% endif %}
author_email:
type: str
help: What is your email? Default is the email from your git config.
default: "{{ get_author_email_from_git() }}"
python_version:
type: str
help: What version of Python do you want to use?
default: "3.12"
use_uv:
type: bool
help: Use uv for managing dependencies?
default: true
use_precommit:
type: bool
help: Use pre-commit?
default: true
use_ruff:
type: bool
help: Use ruff?
default: true
use_mypy:
type: bool
help: Use mypy?
default: true
ci_provider:
type: str
choices:
Github: "github"
Azure: "azure"
get_newest_version_of_libraries_from_web:
type: bool
help: Get the newest version of libraries from the web? Will perform a simple request to determine the latest version of the libraries.
default: true
should_freeze_dependencies:
type: bool
help: |
Freeze dependencies?
If true, will set the dependencies versions with '==' to the latest version of the library.
If false, will set the dependencies versions with '>=' to the latest version of the library.
default: false
required_dependencies_version:
type: json
help: What versions should be used for below dependencies?
default: |
{% set deps_with_versions = {"mdformat": "0.7.18"} %}
{% if use_precommit %}
{% set _ = deps_with_versions.update({"pre-commit": "5.0.0"}) %}
{% endif %}
{% if use_ruff %}
{% set _ = deps_with_versions.update({"ruff": "0.7.3"}) %}
{% endif %}
{% if use_mypy %}
{% set _ = deps_with_versions.update({"mypy": "1.13.0"}) %}
{% endif %}
{{ deps_with_versions | tojson }}
should_ask_for_dependencies:
type: bool
help: Should we ask for the dependencies?
default: false
app_dependencies:
type: json
multiline: true
help: What app dependencies do you need?
default: "{}"
when: "{{ should_ask_for_dependencies }}"
dev_dependencies:
type: json
multiline: true
help: Add additional development dependencies.
when: "{{ should_ask_for_dependencies }}"
default: |
{% set dev_dependencies = [
"pytest",
"pytest-cov",
"pytest-pretty",
"pytest-randomly",
"pytest-xdist"
] %}
{% if use_mypy %}
{% set _ = dev_dependencies.append("mypy") %}
{% endif %}
{% if use_ruff %}
{% set _ = dev_dependencies.append("ruff") %}
{% endif %}
{% if use_precommit %}
{% set _ = dev_dependencies.append("pre-commit") %}
{% endif %}
{% set dev_dependencies = dev_dependencies | unique | sort %}
{{ dev_dependencies | tojson }}