forked from entelecheia/hyperfast-python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopier.yaml
181 lines (150 loc) · 5.88 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
_subdirectory: .copier-template
# Configure jinja2 defaults to make syntax highlighters lives easier
_templates_suffix: .jinja
_envops:
block_end_string: "%}"
block_start_string: "{%"
comment_end_string: "#}"
comment_start_string: "{#"
keep_trailing_newline: true
variable_end_string: "}}"
variable_start_string: "{{"
_answers_file: .copier-config.yaml
_tasks:
# Strings get executed under system's default shell
- "[ -d .git ] || git init"
- "{% if github_repo_name %}git add remote origin https://github.com/{{ github_username }}/{{ github_repo_name }}.git 2>/dev/null || echo 'origin already exists'{% else %}echo 'No GitHub repository name provided. Skipping git remote add.'{% endif %}"
# if code_template_source and code_template_source != 'None' is not empty, apply the code template
- "{% if code_template_source and code_template_source != 'None' %}copier copy --trust --data 'project_name={{project_name}}' --data 'package_name={{package_name}}' --data 'open_link={{open_link}}' --answers-file {{ code_template_answers_file }} {%- if project_name.endswith('-template') %} --vcs-ref=HEAD{% endif %} {{ code_template_source }} .{% else %}echo 'No code template source provided. Skipping copier.'{% endif %}"
# questions
project_name:
type: str
help: What is your project name? (it will be used in `pip install project_name`)
validator: >-
{% if not (project_name | regex_search('^[a-zA-Z][a-zA-Z0-9\-]+$')) %}
project_name must start with a letter, followed one or more letters, digits or dashes in lowercase only
{% endif %}
friendly_name:
default: "{{ project_name }}"
type: str
help: What is your project friendly name? (it will be used for the title of the documentation)
project_short_description:
type: str
help: What is your project short description?
project_description:
type: str
help: What is your project description?
project_license:
type: str
choices:
- MIT
- CC-BY-4.0
- Apache-2.0
- GPLv3
- None
author:
type: str
help: What is your name?
validator: >-
{% if not (author | regex_search('^[a-zA-Z][a-zA-Z ]+$')) %}
author must start with a letter, followed one or more letters or spaces
{% endif %}
github_username:
type: str
help: What is your GitHub username?
validator: >-
{% if not (github_username | regex_search('^[a-z0-9][a-z0-9\-]+$')) %}
github_username must start with a letter or digit, followed one or more letters, digits or dashes in lowercase only
{% endif %}
email:
default: "{{ github_username }}@"
type: str
help: What is your email?
validator: >-
{% if not (email | regex_search('^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$')) %}
email must be a valid email address
{% endif %}
github_repo_name:
default: "{{ project_name }}"
type: str
help: What is your GitHub repository name?
main_branch:
default: main
type: str
help: What is your main branch name?
build_and_release:
default: true
type: bool
help: Do you want to build and release the package?
package_name:
default: "{{ project_name | replace('-', '_') }}"
type: str
help: What is your Python module name? (it will be used in `import package_name`)
validator: >-
{% if not (package_name | regex_search('^[a-z][a-z0-9_]+$')) %}
package_name must start with a letter, followed one or more letters, digits or underscores in lowercase only
{% endif %}
package_scripts:
default: "[{{ package_name }} = '{{ package_name }}.__cli__:main']"
type: yaml
help: What are the scripts of your Python package? (it will be used as CLI entry points)
upload_to_release:
default: "{{ build_and_release | lower }}"
type: bool
help: Do you want to upload the assets built to the GitHub release?
upload_to_repository:
default: "{{ build_and_release | lower }}"
type: bool
help: Do you want to upload the package to the PyPI repository?
documentaion_tool:
default: jupyter-book
type: str
choices:
- jupyter-book
- mkdocs
- none
help: What documentation tool do you want to use?
copyright_year:
default: "{{ '%Y' | strftime }}"
type: int
help: What is the copyright year?
documentation_url:
default: "https://{{ github_username }}.github.io/{{ github_repo_name }}"
type: str
help: What is your documentation URL?
favicon_path:
type: str
help: What is the path to your favicon? (leave empty if you don't have one. e.g. favicon.png or https://example.com/favicon.png)
logo_path:
type: str
help: What is the path to your logo? (leave empty if you don't have one. e.g. logo.png or https://example.com/logo.png)
use_launch_buttons:
default: false
type: bool
help: Do you want to use launch buttons in your documentation? (it is only available for Jupyter Book)
google_analytics_id:
type: str
help: What is your Google Analytics ID? (leave empty if you don't have one. e.g. G-XXXXXXXXXX)
codecov_graph_token:
default: "[REPLACE_ME]"
type: str
help: What is your Codecov graph token? (leave empty if you don't have one. e.g. XXXXXXXXXX) You can find it in https://app.codecov.io/gh/{{ github_username }}/{{ github_repo_name }}/settings
poe_task_files:
default: "['.tasks.toml', '.tasks-extra.toml']"
type: yaml
help: What are the POE task files? (e.g. ['.tasks.toml', '.tasks-extra.toml'])
use_source_code_skeleton:
default: "{{ build_and_release | lower }}"
type: bool
help: Do you want to use the source code skeleton? (it will create `src` and `tests` directories)
open_link:
type: bool
help: Do you want to open the project homepage link when you run CLI commands?
code_template_source:
default: ""
type: str
help: What is the URL of the code template to apply to the project? (leave empty if you don't want to apply a code template. e.g. gh:entelecheia/hyfi-template)
code_template_answers_file:
default: .copier-hyfi-config.yaml
type: str
help: What is the path to the answers file of the code template? (e.g. .copier-hyfi-config.yaml)