A Copier template for modern Python projects.
Demo repo generated from this template: mgaitan/yet-another-demo
- π Modern Python package (3.12+)
- π¦ Build and dependency management with uv, split by groups (dev/qa/docs)
- π§Ή Linting and formatting via Ruff with a broad set of rules enabled
- β Type checking via ty
- π§ͺ Tests with pytest, coverage.py and extensions
- π Docs with Sphinx, MyST and a few extensions, deployed to GitHub Pages
- ποΈ Use of GitHub CLI for autotic project creation
- βοΈ CI workflow on GitHub Actions
- π Automated releases to PyPI via Trusted Publishing
- π§ Sensible defaults via introspection to minimize answers during the initial setup
- π οΈ Makefile with shortcuts for common tasks
- π Generation of generic docs such as
LICENSE,CODE_OF_CONDUCT, etc. - π€ Heavily curated AGENTS.md
- π Initial setup of the development environment and git repo
- π Scheduled template refresh workflow that opens a PR every 20 days when updates are available
- β»οΈ Projects updatable with
copier update
Please read my blog post to learn about the details of the decisions I made and the alternatives I considered.
Quick shortcut (auto-detects copy vs update):
uvx git+https://github.com/mgaitan/python-package-copier-template [DESTINATION]This runs copier copy --defaults --unsafe to DESTINATION (or . if omitted) when no .copier-answers.yml is present, or copier update --defaults --unsafe when it is.
Check the installed version with uvx git+https://github.com/mgaitan/python-package-copier-template -- --version.
Start a new project explicitly with Copier:
uvx --with=copier-template-extensions copier copy --trust "gh:mgaitan/python-package-copier-template" /path/to/your/new/projectTo upgrade an existing project created from this template to the latest version, run:
uvx --with=copier-template-extensions copier update . --trust This will fetch the latest template version and guide you through updating your project, preserving your customizations whenever possible.
The generated project also ships a Template Update GitHub Actions workflow that runs every 20 days (or on manual dispatch) to execute uvx copier update --trust --defaults . and open a pull request with the changes and template version bump.
To test a development version of the template, clone the repository and run:
uv sync
uv run copier copy --trust --vcs-ref=HEAD . /path/to/your/test/projectIf you create the GitHub repository via the gh CLI prompt, the template will attempt to enable GitHub Pages (using the Actions build type) so documentation deployments succeed. If Pages is unavailable (for example, with some private repositories or account policies), the docs workflow will keep failing until Pages is allowed.
To publish a release of your project to PyPI, you need to register the project with trusted published. Read more about how this workflow works here
Then
$ make bump # optional
$ make release
This project template started as a fork of pawamoy/copier-uv. Then I simplified and changed it to fit my needs.