A Copier template for Python projects with opinionated tooling.
Warning This template is in a pretty early stage of development. Things can be unstable and changed without notice. Use at your own risk.
- GitHub Actions: CI workflows for git hooks and tests
- uv: Python dependency management
- prek: Git hooks manager/wrapper
- ruff: Linting and formatting
- ty: Type checking (optional)
- Renovate: Automated dependency updates
- pytest + pytest-xdist + pytest-randomly: Python testing
- Codecov: Test coverage reporting (optional)
- Copier >= 9.0.0
- copier-template-extensions
- uv
- prek
Make sure all the requirements are met. Copier and copier-related dependencies can be installed using
uv tool install "copier>=9" --with "copier-template-extensions==0.3.3"copier copy --trust gh:ulgens/python-anything ./my-awesome-project| Question | Description | Default | Options | For |
|---|---|---|---|---|
project_name |
Project name | my-awesome-project |
Free text input | All |
project_description |
One-line description | Free text input | All | |
author_name |
Author name | Jane Doe |
Free text input | All |
author_email |
Author email | [email protected] |
Free text input | All |
github_username |
GitHub username or organization | janedoe |
Free text input | All |
project_type |
Project type | Application |
Application, Library |
All |
python_version |
Python version (X.Y.Z) | Latest stable patch release | Any valid Python version | App |
min_python_version |
Minimum supported Python version (inclusive) | 3.12 |
3.11, 3.12, 3.13, 3.14, 3.15 |
Lib |
max_python_version |
Maximum supported Python version (exclusive) | 3.15 |
3.12, 3.13, 3.14, 3.15, 3.16 |
Lib |
license |
License type | MIT |
MIT, BSD-3-Clause, Apache-2.0, GPL-3.0, None |
All |
frameworks |
Frameworks & libraries to include | None | Click, FastAPI, LangChain | App |
use_codecov |
Enable Codecov integration | false | true, false | All |
use_ty |
Enable ty type checker | false | true, false | All |
cd my-project
prek install
git remote add origin [email protected]:<username>/<project-name>.git
git commit -m "Initial commit"
git push -u origin mainTo adopt this template in a project that already exists:
-
Make sure all changes are committed so you can review the template's changes as a diff:
git status # should be clean -
Run
copier copyfrom the project root:copier copy --trust gh:ulgens/python-anything . -
Answer the template questions to match your existing project (name, author, Python version, etc.).
-
Review the changes. Key files to check:
pyproject.toml: Merge your existing dependencies into the template's structure. The template usesdependency-groupsfor dev dependencies and pinned versions.- Source layout: The template expects code in
src/and tests insrc/tests/. Move your code if it lives elsewhere. .github/workflows/: Decide whether to keep your existing CI or adopt the template's.- Config files (
ruff.toml,.pre-commit-config.yaml, etc.): Generally safe to accept the template's versions.
-
If you made manual changes after the copy (e.g., merging dependencies, moving files), run the hooks again:
prek run --all-files
-
Review the full diff and commit:
git diff --staged git commit -m "Adopt python-anything template"
After this, .copier-answers.yml enables copier update --trust for future template updates.
copier update --trustmy-project/
├── .copier-answers.yml
├── .github/
│ └── workflows/
│ ├── git-hooks.yml
│ └── tests.yml
├── .gitignore
├── .pre-commit-config.yaml
├── LICENSE # (if license != None)
├── README.md
├── pyproject.toml
├── renovate.json5
├── ruff.toml
├── src/
│ └── tests/
│ ├── __init__.py
│ └── test_sample.py
├── uv.lock # (generated by post-copy task)
└── yamlfmt.yaml
Selecting frameworks affects:
- pyproject.toml: Adds pinned dependencies for the selected frameworks
- ruff.toml: Enables framework-specific lint rules:
- FastAPI:
FASTrules
- FastAPI:
If you enabled Codecov integration (use_codecov: true), follow these steps after generation:
- Sign up at codecov.io and add your repository.
- Copy the upload token from Codecov's repository settings.
- Add the token as a GitHub Actions secret named
CODECOV_TOKENin your repository settings (Settings > Secrets and variables > Actions).
Once configured, coverage reports will be uploaded automatically on every push to main and on pull requests.
- Django: Use ulgens/django-blasphemy for Django projects.
MIT License - see LICENSE for details.