forked from linkml/linkml-project-copier
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yaml
More file actions
148 lines (126 loc) · 4.15 KB
/
Copy pathcopier.yaml
File metadata and controls
148 lines (126 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
# === 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
# Catch invalid input and show a friendly message.
validator: >-
{% if not (project_name | regex_search('^[A-Za-z][A-Za-z0-9 _\-]*[A-Za-z0-9]$',
ignorecase=False)) %}
Use 2+ of letters, digits, space, '-', '_'; start with letter, end alnum.
{% endif %}
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)) %}
Start with a lowercase letter, then lowercase letters, digits, '-' or '_'.
{% 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.
existing_license_file:
help: |
Path to an existing license file you want to keep (e.g. LICENSE.md, LICENCE.txt).
Leave empty to generate one for the license you pick next.
type: str
default: ""
license:
help: |
Which license do you want for your project? Pick "Custom" if you supplied an
existing license file above whose content does not match any of the listed
SPDX licenses; that records the PEP 639 identifier `LicenseRef-Custom` in
pyproject.toml, signalling "see the license file".
type: str
choices:
Apache-2.0: Apache-2.0
MIT: MIT
BSD-3-Clause: BSD-3-Clause
MPL-2.0: MPL-2.0
LGPL-3.0-only: LGPL-3.0-only
GPL-3.0-only: GPL-3.0-only
Custom: LicenseRef-Custom
default: "{{ 'LicenseRef-Custom' if existing_license_file else 'Apache-2.0' }}"
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' }}"