https://github.com/liblaf/copier-python
๐ A modern Copier template for Python projects. Pre-configured with mise, ruff, pytest, mkdocs, and GitHub Actions workflows for seamless development.
https://github.com/liblaf/copier-python
automation code-quality continuous-integration copier copier-template github-actions jinja package-management python repository-structure template
Last synced: 3 months ago
JSON representation
๐ A modern Copier template for Python projects. Pre-configured with mise, ruff, pytest, mkdocs, and GitHub Actions workflows for seamless development.
- Host: GitHub
- URL: https://github.com/liblaf/copier-python
- Owner: liblaf
- License: mit
- Created: 2024-10-16T08:43:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-25T09:32:43.000Z (5 months ago)
- Last Synced: 2026-01-26T00:27:39.581Z (5 months ago)
- Topics: automation, code-quality, continuous-integration, copier, copier-template, github-actions, jinja, package-management, python, repository-structure, template
- Language: Shell
- Homepage:
- Size: 386 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README

**[Browse the template files ยป](https://github.com/liblaf/copier-python/tree/main/template)**
[](https://github.com/copier-org/copier)
[](https://github.com/liblaf/copier-python/actions/workflows/mega-linter.yaml)
[](https://github.com/liblaf/copier-python/actions/workflows/release-pr.yaml)
[](https://github.com/liblaf/copier-python/actions/workflows/copier-update.yaml)
[Changelog](https://github.com/liblaf/copier-python/blob/main/CHANGELOG.md) ยท [Template Files](https://github.com/liblaf/copier-python/tree/main/template) ยท [Report Bug](https://github.com/liblaf/copier-python/issues) ยท [Request Feature](https://github.com/liblaf/copier-python/issues)

## ๐ What Is `copier-python`?
`copier-python` is the Python layer in the `liblaf` Copier stack. It adds packaging, typed source layout, documentation, testing, benchmarking, and PyPI publishing on top of the shared repository and release foundations.
> [!IMPORTANT]
> This template depends on [`gh:liblaf/copier-shared`](https://github.com/liblaf/copier-shared) and [`gh:liblaf/copier-release`](https://github.com/liblaf/copier-release). Apply the stack in that order: shared โ release โ python.
If you want the real source of truth for generated files, start in [`template/`](https://github.com/liblaf/copier-python/tree/main/template). This repository README documents the template itself; the generated project README comes from [`template/README.md.jinja`](https://github.com/liblaf/copier-python/blob/main/template/README.md.jinja).
## โจ What You Get
- ๐ฆ A modern Python package layout under `src/`, including `py.typed`, version stubs, and lazy-loader-friendly package exports.
- โ๏ธ A `pyproject.toml` wired for PEP 621 metadata, `uv` dependency groups, Hatchling builds, and Hatch VCS versioning.
- ๐งช A `noxfile.py` with multi-version test sessions, dependency resolution variants, and optional benchmark sessions.
- ๐ Docs scaffolding with Zensical, MkDocs Material, mkdocstrings, GitHub-friendly Markdown, and Read the Docs configuration.
- ๐ Release automation that fits the rest of the `liblaf` Copier stack, including changelog generation, draft releases, and PyPI publishing through OIDC.
- ๐ Copier-friendly update paths so the generated repository can be refreshed later without redoing the whole setup by hand.
## ๐ Apply The Template
After applying the shared and release templates, add the Python layer with:
```bash
copier copy --trust gh:liblaf/copier-python .
```
## ๐ Update The Template
To refresh the Python layer in an existing repository:
```bash
copier recopy --trust --answers-file '.config/copier/.copier-answers.python.yaml'
```
The generated repository usually keeps separate Copier answers files for each layer, so scheduled update workflows can refresh the whole stack over time.
## ๐งฑ Template Stack
- ๐งฐ [`gh:liblaf/copier-shared`](https://github.com/liblaf/copier-shared): repository hygiene, common automation, editor settings, and shared project metadata.
- ๐ท๏ธ [`gh:liblaf/copier-release`](https://github.com/liblaf/copier-release): release PRs, changelog generation, Git tags, GitHub Releases, and publish orchestration.
- ๐ [`gh:liblaf/copier-python`](https://github.com/liblaf/copier-python): Python packaging, docs, tests, benchmarks, and PyPI workflow wiring.
## ๐ข Release Workflow
In a generated project, the default release flow looks like this:
1. Push commits using Conventional Commits.
2. `release-pr.yaml` creates a release PR with the changelog and updated version.
3. Merge the release PR yourself, or approve it and let [`mergery[bot]`](https://github.com/apps/mergery) merge it once the button is green.
4. `release-draft.yaml` creates a draft release.
5. `python-release.yaml` builds the package, publishes it to PyPI with GitHub OIDC, and uploads release assets to the draft release.
6. `release-publish.yaml` publishes the draft release after 6 hours so the release jobs have enough time to finish.
## ๐ ๏ธ Post Setup
### ๐ Read the Docs
1. Visit .
2. Follow the prompts to import the generated repository.
3. Configure these settings:
| Location | Value |
| --- | --- |
| `Setup > Settings > Default version` | `stable` |
| `Setup > Settings` | Enable `Build pull requests for this project` |
| `Setup > Addons > Analytics` | Enable |
| `Setup > Addons > Link previews` | Enable |
| `Building > Pull request builds` | Enable `Build pull requests for this project` |
| `Building > Pull request builds` | Enable `Show build overview in a comment` |
4. Add this automation rule:
| Field | Value |
| --- | --- |
| `Description` | `Semantic Versioning` |
| `Match` | `SemVer versions` |
| `Version type` | `Tag` |
| `Action` | `Activate version` |
### ๐ฆ PyPI Trusted Publishing
1. Visit .
2. Create a trusted publisher for the generated repository.
3. Point it at the GitHub Actions release workflow created by this template stack.
This template publishes with GitHub OIDC, so you do not need a long-lived PyPI API token.
## ๐ค Contributing
To improve the template, edit the files under [`template/`](https://github.com/liblaf/copier-python/tree/main/template) and the small helper files around it, then keep commit messages in Conventional Commits format so the release automation can do its job cleanly.
[](https://github.com/liblaf/copier-python/pulls)
[](https://github.com/liblaf/copier-python/graphs/contributors)
## ๐ More Copier Templates
- **[Shared](https://github.com/liblaf/copier-shared)** - โจ Automated code quality, repository hygiene, and project-wide defaults for the rest of the template stack.
- **[Release](https://github.com/liblaf/copier-release)** - ๐ Release PRs, changelog generation, tags, GitHub Releases, and publishing automation.
- **[Python](https://github.com/liblaf/copier-python)** - ๐ Python packaging, docs, tests, benchmarks, and PyPI workflow wiring.
- **[Rust](https://github.com/liblaf/copier-rust)** - ๐ฆ Rust project template with modern tooling and CI/CD.
- **[TypeScript](https://github.com/liblaf/copier-typescript)** - ๐ TypeScript project template with modern runtime, tooling, and release automation.
---
#### ๐ License
Copyright ยฉ 2024 [liblaf](https://github.com/liblaf).
This project is [MIT](https://github.com/liblaf/copier-python/blob/main/LICENSE) licensed.