python-project-template is a starter template for Python projects with advanced setup for code quality tools, static analysis, formatting, testing, coverage control, dependency security auditing, and release automation.
This template uses modern tooling such as uv, ruff, mypy, pytest, pre-commit, commitizen, hatchling and gitleaks, along with a ready-to-use Taskfile.yml for convenient task management.
The project comes pre-configured with:
- Code formatting and linting via
ruff - Static type checking via
mypy - Testing with
pytest - Coverage reporting via
coverage - Security auditing via
pip-audit - Unused dependency detection via
deptry - Conventional commits & versioning via
commitizen - Git hooks via
pre-commit - Secret scanning via
gitleaks - Packaging with
hatchling - Dependency management via
uv
All settings target Python 3.13 with a max line length of 88 characters.
-
Make sure you have Python 3.13 or newer installed.
-
Sync dependencies (including dev group):
task sync- Install Git hooks:
task init- Run the application (example module
app.main):
task runBuild image:
task docker-buildRun container:
task docker-runBuild and run:
task dockerAuto-fix lint issues and format code:
task fmtRun Ruff and MyPy:
task lintTests with Coverage:
task testSecurity audit:
task auditDetect unused libraries:
task unused-libsFull Quality Check:
task checkCommit using Conventional Commits:
task cz-commitCheck commit messages:
task cz-checkBump version and update changelog:
task cz-bumpRelease (bump + push tags):
task releaseThis project is licensed under the MIT License. See the LICENSE file for details.