Skip to content

johhnry/python-package-template

Repository files navigation

Python package template

This repository is a Python package template that uses modern tooling and packaging like Poetry, Mypy, Ruff...

This is intended to be a demonstration of how good Python tooling and DX became over the years.

Tools

  • Poetry: dependency and virtualenv management
  • Mypy: PEP484 compliant static type checker
  • Ruff: an extremely fast Python linter, written in Rust
  • Black: the uncompromising Python code formatter
  • Isort: sort Python imports automatically
  • Pytest (+ pytest-cov code coverage): unit test runner
  • Pre-commit: multi-language pre-commit Git hooks

Usage

First install the dependencies:

$ poetry config virtualenvs.in-project true # Use .venv folder in project
$ poetry install

Then with the help of Poe the Poet, a task runner for Poetry similar to NodeJS's package.json scripts, you can launch different actions:

$ poetry run poe --help

CONFIGURED TASKS
  test           Run tests with code coverage
  format-check   Check code style
  lint-check     Lint code
  type-check     Static type checking
  imports-check  Check import order
  check-all

About

Python package template with modern tooling

Resources

Stars

Watchers

Forks

Languages