-
Notifications
You must be signed in to change notification settings - Fork 15
/
copier.yml
206 lines (171 loc) · 6.2 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
_message_before_copy: |
Thanks for generating a project using LINCC's template.
You'll be asked a series of questions whose answers will be used to
generate a tailored project for you.
You can refer to our documentation for more details and contact info
https://lincc-ppt.readthedocs.io/en/latest/source/new_project.html#template-questions
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 | regex_search('^[a-z][a-z0-9\_\-]+$')) %}
Must use a lowercase letter followed by one or more of (a-z, 0-9, _, -).
{% endif %}
package_name:
type: str
help: What is your python package name?
default: example_package
validator: >-
{% if not (package_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_organization:
type: str
help: What github organization will your project live under?
default: my-organization
validator: >-
{% if not (project_organization | 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_name:
type: str
help: What is the name of the code author? (Can be a person or organization)
default: Your Name
author_email:
type: str
help: Code author's preferred email address?
default: [email protected]
project_license:
help: What license would you like to use?
type: str
default: MIT
choices:
MIT: MIT
BSD: BSD
GPLv3: GPL3
none: none
python_versions:
help: What versions of python are you targeting? We will add automated testing for these versions.
default: ["3.9", "3.10", "3.11"]
type: str
multiselect: true
choices:
"3.8 (end-of-life)": "3.8"
"3.9": "3.9"
"3.10": "3.10"
"3.11": "3.11"
"3.12": "3.12"
"3.13": "3.13"
when: "{{ custom_install }}"
enforce_style:
help: What tooling set would you like to use to enforce code style? Use SPACE to highlight all that apply.
type: str
default: [ruff_lint, ruff_format]
multiselect: true
choices:
ruff linting: ruff_lint
ruff auto-formatter: ruff_format
pylint: pylint
black: black
isort: isort
when: "{{ custom_install }}"
failure_notification:
help: How would you like to receive workflow failure notifications?
type: str
default: []
multiselect: true
choices:
email (additional configuration required): email
slack bot integration (additional configuration required): slack
when: "{{ custom_install }}"
mypy_type_checking:
help: Would you like to include mypy to perform static type checking for type hints?
type: str
default: none
choices:
No type checking: none
Add basic type checking for code that has type hints: basic
Add strict type checking to enforce that type hints are used: strict
when: "{{ custom_install }}"
create_example_module:
help: Do you want to create some example module code?
type: bool
default: yes
choices:
yes: true
no: false
when: "{{ custom_install }}"
include_docs:
help: Do you want to include a directory for sphinx, and autoapi generation?
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_benchmarks:
help: Do you want to enable benchmarking?
type: bool
default: yes
choices:
yes: true
no: false
when: "{{ custom_install }}"
_message_after_copy: |
Your project "{{ project_name }}" has been created successfully!
There are a few more manual steps to finish the setup.
Go to your project directory, create a virtual environment, and run the initialization script:
$ cd {{ _copier_conf.dst_path }}
$ python3 -mvenv ~/.virtualenvs/{{ project_name }} && source ~/.virtualenvs/{{ project_name }}/bin/activate
$ bash .initialize_new_project.sh
Push your project to a new repository on GitHub:
$ git remote add origin https://github.com/{{project_organization}}/{{project_name}}.git
$ git push -u origin main
{%- if include_notebooks %}
Install pandoc to build your documentation locally
$ conda install pandoc
{%- endif %}
{%- if "email" in failure_notification %}
Follow these instructions to set up email notifications:
https://lincc-ppt.readthedocs.io/en/latest/practices/ci_testing.html#email-notifications
{%- endif %}
{%- if "slack" in failure_notification %}
Follow these instructions to set up slack notifications:
https://lincc-ppt.readthedocs.io/en/latest/practices/ci_testing.html#slack-notifications
{%- endif %}
{%- if include_benchmarks %}
Follow these instructions to set up benchmarking
https://lincc-ppt.readthedocs.io/en/latest/practices/ci_benchmarking.html#set-up
{%- endif %}
Finally, a few items to consider:
- Set up branch protection rules in github
- Enable dependabot in github
- Add another GitHub user as an administrator on the repository
These steps are detailed at
https://lincc-ppt.readthedocs.io/en/latest/source/configuration_checklist.html
###
# Below this line are Copier configuration options.
###
# Subdirectory that contains the python-project-template. Allows template metadata to be separated from the template.
_subdirectory: python-project-template
_skip_if_exists:
- README.md
# Require that the user has at least Copier v9.1.0 installed
# Earliest version with "multiselect" support.
_min_copier_version: "9.1.0"