Skip to content

Latest commit

 

History

History
executable file
·
143 lines (95 loc) · 2.39 KB

File metadata and controls

executable file
·
143 lines (95 loc) · 2.39 KB

🐍 Python Project Template

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.

📦 Dependencies

⚙️ Configuration & Features

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.

🛠️ Installation & Usage

💻 Local Setup

  1. Make sure you have Python 3.13 or newer installed.

  2. Sync dependencies (including dev group):

task sync
  1. Install Git hooks:
task init
  1. Run the application (example module app.main):
task run

🐳 Docker

Build image:

task docker-build

Run container:

task docker-run

Build and run:

task docker

🧪 Development Commands

Auto-fix lint issues and format code:

task fmt

Run Ruff and MyPy:

task lint

Tests with Coverage:

task test

Security audit:

task audit

Detect unused libraries:

task unused-libs

Full Quality Check:

task check

🚀 Release Management

Commit using Conventional Commits:

task cz-commit

Check commit messages:

task cz-check

Bump version and update changelog:

task cz-bump

Release (bump + push tags):

task release

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.