-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yml
More file actions
152 lines (124 loc) · 4.15 KB
/
Copy pathcopier.yml
File metadata and controls
152 lines (124 loc) · 4.15 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
---
!include constants.yml
---
_subdirectory: reproML
_answers_file: .reproML.yml
# basics
project_name:
type: str
help: What is your project name?
default: "{{ _folder_name }}"
validator: "{% if project_name|length < 1 %}Can not be empty.{% endif %}"
project_name_slug:
type: str
help: A slug of the name
default: "{% from 'slugify.jinja' import slugify %}{{ slugify(project_name) }}"
validator: "{% if project_name_slug|length < 1 %}Can not be empty.{% endif %}{% from 'slugify.jinja' import slugify %}{% if project_name_slug != slugify(project_name_slug) %}Invalid slug.{% endif %}"
project_description:
type: str
help: A brief summary of what you want to achieve.
python_version:
type: str
help: Which Python version do you want to use?
choices:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
author:
type: str
help: What is your name?
author_email:
type: str
help: What is your email adress?
# git integration
git_config:
type: bool
help: "Do you want to use these details for the initial commit?"
default: true
choices:
"Yes, use '{{author}}' and '{{author_email}}'.": true
No, use global git defaults.: false
ci:
type: str
help: What CI service do you want to use?
choices:
Skip for now: ""
GitHub Actions: github
GitLab CICD: gitlab
repo_url:
type: str
help: Where is the git repo hosted? Keep empty to skip.
default: ""
default_branch:
type: str
help: What do you want to name your default branch?
default: main
validator: "{% from 'slugify.jinja' import slugify %}{% if default_branch != slugify(default_branch) %}Invalid branch name.{% endif %}"
# dvc
use_dvc:
type: bool
help: Dou you want to use data version control?
default: false
remote_type:
type: str
help: Which storage backend do you want to install? If in doubt, start without one.
choices:
Install no backend: ""
Amazon S3: s3
Microsoft Azure Blob Storage: azure
Google Cloud Storage: gs
Google Drive: gdrive
SSH and SFTP: ssh
HDFS: hdfs
WebDAV: webdav
Aliyun OSS: oss
Install all backends: all
default: ""
when: "{{ use_dvc }}"
remote_location:
type: str
help: Supply remote storage location. Keep empty to skip.
placeholder: "{{ remote_type }}://"
default: ""
when: "{% if remote_type != '' %}{% if remote_type != 'all' %}{{ use_dvc }}{% endif %}{% endif %}"
# extra documentation
ethics_checklist:
type: bool
help: Do you want to add the deon ethics checklist to your documentation?
default: true
# commands to run post generation
_tasks:
# setup repo
- command: "git init"
when: "{{ _copier_operation != 'update' }}"
- command: "git config user.name {{author}}"
when: "{{ git_config and _copier_operation != 'update' }}"
- command: "git config user.email {{author_email}}"
when: "{{ git_config and _copier_operation != 'update' }}"
- command: "git remote add origin {{repo_url}}"
when: "{{ repo_url != '' and _copier_operation != 'update' }}"
- command: "git remote set-url origin {{repo_url}}"
when: "{{ repo_url != '' and _copier_operation == 'update' }}"
# setup environment
- "uv sync --python {{python_version}} --all-groups --all-extras"
- command: "uv run pre-commit install --hook-type pre-push --hook-type post-checkout --hook-type pre-commit"
when: "{{ _copier_operation != 'update' }}"
# setup dvc
- command: "uv run dvc remote add -d remote0 {{remote_location}}"
when: "{{ remote_location != '' and _copier_operation != 'update' }}"
- command: "uv run dvc remote modify remote0 url {{remote_location}}"
when: "{{ remote_location != '' and _copier_operation == 'update' }}"
# extra documentation
- command: "uv run --with deon deon -o docs/ethics.md"
when: "{{ ethics_checklist and _copier_operation != 'update' }}"
# initial commit
- command: "git checkout -b {{default_branch}}"
when: "{{ _copier_operation != 'update' }}"
- command: "git add ."
when: "{{ _copier_operation != 'update' }}"
- command: "git commit -m 'Init from template: github.com/Excidion/reproML'"
when: "{{ _copier_operation != 'update' }}"
_exclude:
- docs/reproML.md # only for docs of template itself