-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcopier.yaml
More file actions
131 lines (110 loc) · 3.32 KB
/
copier.yaml
File metadata and controls
131 lines (110 loc) · 3.32 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
# === Include other yaml files (optional) ===
# https://copier.readthedocs.io/en/stable/configuring/#include-other-yaml-files
# === Questions to answer when generating a project from this template. ===
# https://copier.readthedocs.io/en/stable/configuring/#advanced-prompt-formatting
project_name:
type: str
help: What is your project name?
default: my-awesome-schema
project_slug:
type: str
help: A slug of the name. Must be a valid and unused Python package name.
default: >-
{% from pathjoin('includes', 'slugify.jinja') import slugify -%}
{{ slugify(project_name) }}
# regex_search is part of a jinja extension loaded by default.
# It is case insensitive by default. We need to set ignorecase=False to make
# it case sensitive.
validator: >-
{% if not (project_slug | regex_search('^[a-z][_a-z0-9\-]+$',
ignorecase=False)) %}
project_slug must start with a lowercase letter, followed by lowercase
letters, digits, dashes or underscores.
{% endif %}
email:
help: Email address
type: str
default: my-name@my-org.org
full_name:
help: Developer full name
type: str
default: My Name
github_org:
help: Github user or organisation name
type: str
default: my-org
project_description:
help: A short description of the project
type: str
default: This is the project description.
license:
help: Which license do you want for your project?
type: str
choices:
- MIT
- BSD-3-Clause
- Apache-2.0
- MPL-2.0
- LGPL-3.0-only
- GPL-3.0-only
default: MIT
copyright_year:
help: The year of the first release
type: str
default: "{% now 'utc', '%Y' %}"
author:
help: The author of the schema in the format "Full Name <email>"
type: str
default: "{{ full_name }} <{{ email }}>"
when: false # Make it a computed value. Neither ask for it nor store it.
add_example:
help: |
Add an example schema including python package generation & tests?
Choose "no" if you want to apply the template to an existing project.
type: bool
default: true
gh_action_pypi:
help: Use GitHub actions to publish to PyPI?
type: bool
default: true
gh_action_docs_preview:
help: |
Use GitHub actions for a documentation preview in pull requests?
type: bool
default: true
# === copier configuration options ===
# https://copier.readthedocs.io/en/stable/configuring/#available-settings
_subdirectory: template
_min_copier_version: "9.4.0"
_jinja_extensions:
- jinja2_time.TimeExtension
_exclude:
# Files or dirs in template/ that should not be copied to the project
- "copier.yaml"
- "copier.yml"
- "~*"
- "*.py[co]"
- "__pycache__"
- ".git"
_skip_if_exists:
# Files or dirs to not overwrite/update if they already exist in the project
- LICENSE
- README.md
- docs/index.md
- docs/about.md
- examples/README.md
- project/*
- src/{{project_slug}}/datamodel/*
- src/{{project_slug}}/schema/*
- tests/test_data.py
- tests/data/*
_message_after_copy: |
** PROJECT CREATION COMPLETE **
Next step (if you have not previously initialized your project)
run "just setup" in the root of your project directory.
_migrations:
# Migrations are only run on update (not on copy) and only if the update goes
# through or to the specified version.
- version: v0.2.0
command: just _post_upgrade_v020
when: "{{ _stage == 'after' }}"