Repository navigation
Expand file tree
/
Copy pathcopier.yml
More file actions
152 lines (123 loc) · 4.36 KB
/
Copy pathcopier.yml
File metadata and controls
152 lines (123 loc) · 4.36 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
# Copier template for a Python package: uv, setuptools-scm, ruff, pyrefly,
# pytest, Sphinx, GitHub Actions. See README.md.
_min_copier_version: "9.4.0"
_subdirectory: template
_message_after_copy: |
Created {{ project_name }} in {{ _copier_conf.dst_path }}.
Next steps:
cd {{ _copier_conf.dst_path }}
uv lock # resolve the dev tools into uv.lock
git init && git checkout -b main && git add -A && git commit -m "chore: start from python-template"
uv sync # .venv with the package and the dev tools
uv run pre-commit install
uv run just quality-check
The version comes from git tags (setuptools-scm). Tag the first release as
v0.1.0 once there is something to release; until then the version is 0.0.1.devN.
GitHub setup (once):
- Settings > Pages > Source: Deploy from a branch, branch gh-pages, folder
/ (root). The Documentation workflow creates the branch on its first run
on main, so this comes after that run.
- Settings > Secrets and variables > Actions: add CODECOV_TOKEN.{% if publish_to_pypi %}
- On PyPI, add a trusted publisher: workflow publish.yml, environment pypi.
Optionally, Settings > Environments > pypi > Required reviewers: you, so
each upload waits for your approval.{% endif %}
Pull later template changes with: copier update
# --- Author -----------------------------------------------------------------
full_name:
type: str
help: Your full name
default: James Mineau
email:
type: str
help: Your email address
default: jameskmineau@gmail.com
github_username:
type: str
help: GitHub user or organization that will own the repository
default: jmineau
orcid:
type: str
help: ORCID iD (0000-0000-0000-0000), or leave blank
default: "0000-0002-2289-2252"
validator: >-
{% if orcid and not (orcid | regex_search('^[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{3}[0-9X]$')) %}
An ORCID iD looks like 0000-0002-2289-2252
{% endif %}
affiliation:
type: str
help: Affiliation for CITATION.cff and Zenodo, or leave blank
default: University of Utah
# --- Project ----------------------------------------------------------------
project_name:
type: str
help: Human-readable project name (e.g. "My Package")
validator: "{% if not project_name.strip() %}Required{% endif %}"
repository_name:
type: str
help: GitHub repository name
default: "{{ project_name.strip().lower().replace(' ', '-') }}"
distribution_name:
type: str
help: Name on PyPI / in `pip install` (may differ from the import name)
default: "{{ repository_name.lower() }}"
validator: >-
{% if not (distribution_name | regex_search('^[a-z0-9]([a-z0-9._-]*[a-z0-9])?$')) %}
Use lowercase letters, digits, '.', '_' and '-'
{% endif %}
package_name:
type: str
help: Import name (e.g. `import mypackage`)
default: "{{ distribution_name.replace('-', '').replace('.', '_') }}"
validator: >-
{% if not (package_name | regex_search('^[a-z_][a-z0-9_]*$')) %}
Must be a valid lowercase Python identifier
{% endif %}
project_short_description:
type: str
help: One-line description
default: A short description of the project.
python_min:
type: str
help: Oldest supported Python
choices: ["3.11", "3.12", "3.13"]
default: "3.11"
publish_to_pypi:
type: bool
help: Publish releases to PyPI (trusted publishing)?
default: true
docs_notebooks:
type: bool
help: "Run notebooks and Markdown code cells in the docs (myst-nb; adds Jupyter to the dev tools)?"
default: false
test_os:
type: str
help: Operating systems the tests run on
multiselect: true
choices:
Linux: ubuntu-latest
macOS: macos-latest
Windows: windows-latest
default: [ubuntu-latest, macos-latest, windows-latest]
validator: "{% if 'ubuntu-latest' not in test_os %}Include Linux: coverage uploads from it{% endif %}"
copyright_year:
type: str
help: Year for the LICENSE copyright line
default: "2026"
# --- Computed (not asked, not stored in .copier-answers.yml) ------------------
# Bump these here and `copier update` carries them into every project.
python_max:
type: str
default: "3.14"
when: false
python_min_minor:
type: int
default: "{{ python_min.split('.')[1] | int }}"
when: false
python_max_minor:
type: int
default: "{{ python_max.split('.')[1] | int }}"
when: false
uv_version:
type: str
default: "0.12.23"
when: false