Industrialising a Python project

A script that works on your machine is a start. A project the whole team can install, check, test and ship in one command is something else. We set up the modern tooling one piece at a time, and learn a method to debug without guessing.

Duration: 2 days · Level: intermediate

For: Python developers and teams whose projects grew faster than their tooling.

Prerequisites: writing Python regularly.

Industrialising a Python project

Day 1 — A project that holds up

  • Installing Python and projects with uv
  • Describing the project in pyproject.toml
  • Dependencies, groups and the lock file
  • Organising the code base: src layout, packages, entry points
  • Crafting a public API
  • Formatting and linting with ruff
  • Type hints, checked with mypy
  • Standardising commands with poethepoet or just
  • Logs instead of print

Day 2 — Test, check, ship

  • Tests with pytest
  • Measuring coverage
  • Pre-commit hooks
  • Continuous integration: GitHub Actions or GitLab CI
  • Building and publishing a package
  • Documenting the project
  • A debugging method: read the stack trace from the bottom
  • breakpoint(), pdb and ipdb
  • python -X dev and rich.traceback

Elevate Your Python Proficiency!