You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A modern Python package template with batteries included: strict type checking, automated linting, multi-stage Docker builds, MkDocs documentation, and a full CI/CD pipeline via GitHub Actions.
18
4
5
+
Powered by [Copier](https://copier.readthedocs.io) — scaffold a new project in seconds, and keep it up to date as the template evolves.
6
+
19
7
---
20
8
21
9
## Table of Contents
22
10
23
11
-[Features](#features)
24
-
-[Prerequisites](#prerequisites)
25
-
-[Getting Started](#getting-started)
12
+
-[Using this Template](#using-this-template)
13
+
-[Generating a New Project](#generating-a-new-project)
14
+
-[Updating an Existing Project](#updating-an-existing-project)
15
+
-[Template Variables](#template-variables)
16
+
-[Working on the Template Itself](#working-on-the-template-itself)
17
+
-[Prerequisites](#prerequisites)
26
18
-[Option A — Dev Container (recommended)](#option-a--dev-container-recommended)
27
19
-[Option B — Local Setup](#option-b--local-setup)
28
20
-[Project Structure](#project-structure)
@@ -33,12 +25,74 @@ A modern Python package template with batteries included: strict type checking,
33
25
-[Docker](#docker)
34
26
-[CI/CD](#cicd)
35
27
-[Publishing to PyPI](#publishing-to-pypi)
36
-
-[Customizing the Template](#customizing-the-template)
37
28
-[Contributing](#contributing)
38
29
-[License](#license)
39
30
40
31
---
41
32
33
+
## Using this Template
34
+
35
+
### Generating a New Project
36
+
37
+
> **Requirement:** Copier 9.0 or newer. Install it once with:
|`project_name`| Human-readable name (e.g. `My Awesome Library`) |
55
+
|`project_description`| One-line description of the project |
56
+
|`author_name`| Your full name |
57
+
|`author_email`| Your e-mail address |
58
+
|`repo_url`| Full HTTPS GitHub URL (e.g. `https://github.com/owner/repo`) |
59
+
|`module_name`| Python module name — lowercase, underscores only (e.g. `my_library`) |
60
+
61
+
After generation, `git init` and `git add .` are run automatically. Then:
62
+
63
+
```bash
64
+
cd<destination-directory>
65
+
uv sync --locked # install all dependencies
66
+
make help# see available tasks
67
+
```
68
+
69
+
> **Tip:** The answers are stored in `.copier-answers.yml` inside the generated project. Do not delete this file — it is required for future updates.
70
+
71
+
### Updating an Existing Project
72
+
73
+
When this template is updated, regenerate your project to pull in the latest changes:
74
+
75
+
```bash
76
+
cd<your-project>
77
+
copier update
78
+
```
79
+
80
+
Copier replays your original answers, applies the diff, and lets you resolve any conflicts. Review the changes with `git diff` before committing.
81
+
82
+
### Template Variables
83
+
84
+
All variables are validated at prompt time:
85
+
86
+
-`author_email` must match a basic `user@host.tld` pattern.
87
+
-`repo_url` must start with `https://github.com/`.
88
+
-`module_name` must be a valid Python identifier: starts with a lowercase letter, followed by lowercase letters, digits, or underscores.
89
+
90
+
---
91
+
92
+
## Working on the Template Itself
93
+
94
+
The sections below describe the reference project bundled with this template. They also serve as living documentation for the generated project's `README.md`.
95
+
42
96
## Features
43
97
44
98
| Area | Tooling |
@@ -69,8 +123,6 @@ A modern Python package template with batteries included: strict type checking,
69
123
70
124
---
71
125
72
-
## Getting Started
73
-
74
126
### Option A — Dev Container (recommended)
75
127
76
128
The dev container provides a fully configured, reproducible environment with all tools pre-installed (including `act` for local CI testing).
@@ -109,6 +161,7 @@ That's it. Skip to [Development Workflow](#development-workflow).
109
161
cd template
110
162
```
111
163
164
+
112
165
2.**Install uv** (if not already installed):
113
166
114
167
```bash
@@ -337,8 +390,6 @@ The dev container ships with [`act`](https://github.com/nektos/act), which lets
337
390
338
391
---
339
392
340
-
Here's a clean, professional documentation section you can add to your project's **README.md** (or a dedicated `CONTRIBUTING.md` / `RELEASE.md` file).
341
-
342
393
## Publishing to PyPI
343
394
344
395
This project uses [`uv`](https://docs.astral.sh/uv/) for building and publishing. Releases are published automatically via GitHub Actions using **Trusted Publishing** (OIDC), which is the most secure method in 2026 — no long-lived API tokens are required.
@@ -401,25 +452,13 @@ The workflow will:
401
452
402
453
## Customizing the Template
403
454
404
-
After forking or using this template, rename the project to match your package:
405
-
406
-
1.**`pyproject.toml`** — update `name`, `version`, `description`, `authors`, and `requires-python`.
407
-
2.**`src/template/`** — rename the directory to your package name.
408
-
3.**`pyproject.toml`** — update `[tool.hatch.build.targets.wheel] packages` and all `[tool.mypy] files` / `[tool.towncrier] package` references.
409
-
4.**`mkdocs.yml`** — update `site_name` and any repository URLs.
410
-
5.**`.github/workflows/`** — update the Docker registry path and image name in `image.yml`. Also, follow the `PyPi` section in this `README.md` if you would like to publish to `PyPi`.
411
-
6.**`README.md`** — replace badge URLs, logo, and project description.
412
-
7.**`CODEOWNERS`** — replace `@peinser` and `@JoeriHermans` with your GitHub handle(s).
413
-
8.**`docker/Dockerfile`** - replace `template`.
455
+
All renaming and substitution is handled automatically by Copier — see [Using this Template](#using-this-template).
414
456
415
-
Other files containing references to `template`. Adjust accordingly.
457
+
After generation you may still want to manually adjust:
416
458
417
-
```
418
-
./uv.lock
419
-
./CHANGELOG.md
420
-
./src/template/__init__.py
421
-
./src/template/__version__.py
422
-
```
459
+
-**`.github/workflows/image.yml`** — update the Docker registry path and image name.
460
+
-**`CODEOWNERS`** — replace the placeholder GitHub handle(s) with your own.
461
+
-**`docker/entrypoint.sh`** — add your application's startup logic.
0 commit comments