Python project template
This is D. Bohdan's personal template for starting Python projects. As such, it may change without warning, and the maintainer is likely to reject contributions.
Contents
Requirements
This template is for a project managed with uv. It requires uv.
Python ≥ 3.10 and Copier are required to render the template.
Additionally, using the template requires:
- Poe the Poet — task runner
- (Optional) pre-commit — Git pre-commit check runner.
When you create a Git repository for a rendered template,
run the command
pre-commit installin it. - (Optional) tox with tox-uv
The recommended way to install the requirements is with
uv tool:
uv tool install copier uv tool install poethepoet uv tool install pre-commit uv tool install tox --with tox-uv
Assumptions
The template assumes certain things about you and your work. It assumes you want:
- Type annotations
- Extensive linting but not for missing documentation like function docstrings
- Automatic formatting with the Ruff formatter
- Virtual environments managed automatically
- Tests included in sdists
- An
src/package_foo/directory structure (discussion)
The default project type is an application that is an installable package. Minor changes, like removing the console script, are required for a library.
Included tooling
- Ruff — formatter and linter
- Pyright — type-checker
- Pytest — test framework
- shiv — zipapp builder. Builds zipapps for distribution that include their dependencies.
Testing
Run test.py to test the template with filler values.
There are additional requirements for testing:
- Git
License
MIT No Attribution. See LICENSE.