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 and gh: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/. This repository README documents the template itself; the generated project README comes from template/README.md.jinja.
- π¦ A modern Python package layout under
src/, includingpy.typed, version stubs, and lazy-loader-friendly package exports. - βοΈ A
pyproject.tomlwired for PEP 621 metadata,uvdependency groups, Hatchling builds, and Hatch VCS versioning. - π§ͺ A
noxfile.pywith 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
liblafCopier 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.
After applying the shared and release templates, add the Python layer with:
copier copy --trust gh:liblaf/copier-python .To refresh the Python layer in an existing repository:
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.
- π§°
gh:liblaf/copier-shared: repository hygiene, common automation, editor settings, and shared project metadata. - π·οΈ
gh:liblaf/copier-release: release PRs, changelog generation, Git tags, GitHub Releases, and publish orchestration. - π
gh:liblaf/copier-python: Python packaging, docs, tests, benchmarks, and PyPI workflow wiring.
In a generated project, the default release flow looks like this:
- Push commits using Conventional Commits.
release-pr.yamlcreates a release PR with the changelog and updated version.- Merge the release PR yourself, or approve it and let
mergery[bot]merge it once the button is green. release-draft.yamlcreates a draft release.python-release.yamlbuilds the package, publishes it to PyPI with GitHub OIDC, and uploads release assets to the draft release.release-publish.yamlpublishes the draft release after 6 hours so the release jobs have enough time to finish.
- Visit https://app.readthedocs.org/dashboard/import/.
- Follow the prompts to import the generated repository.
- 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 |
- Add this automation rule:
| Field | Value |
|---|---|
Description |
Semantic Versioning |
Match |
SemVer versions |
Version type |
Tag |
Action |
Activate version |
- Visit https://pypi.org/manage/account/publishing/.
- Create a trusted publisher for the generated repository.
- 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.
To improve the template, edit the files under 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.
- Shared - β¨ Automated code quality, repository hygiene, and project-wide defaults for the rest of the template stack.
- Release - π Release PRs, changelog generation, tags, GitHub Releases, and publishing automation.
- Python - π Python packaging, docs, tests, benchmarks, and PyPI workflow wiring.
- Rust - π¦ Rust project template with modern tooling and CI/CD.
- TypeScript - π TypeScript project template with modern runtime, tooling, and release automation.
