Opinionated / Streamlined Python

Sometimes learning all the things feels quite overwhelming. This is a streamlined (minimalist) guide to software development with Python. As such it must be opinionated. One tool is chosen over another, not necessarily because it is better but because we need a path forward.

Note: This is in many ways what I am taking away from TestDriven’s The Complete Python Development Guide.

Linux

For Linux and Mac machines this is pretty easy. If you are using a Windows machine, you’ll need to install Windows Subsystem for Linux (WSL). For our purposes we’ll be using Ubuntu.

Python Version Management

A language version manager provides a simple way to install and use multiple versions of a language. Node.js has nvm, Ruby has rvm, Python has pyenv.

Python Environment and Dependencies Management

We’ll be using Poetry (the other big player is pipenv).

Testing

We’ll use pytest.

  • Mocking – Built into pytest.
    • Use pytest-mock
    • Use pytest monkeypatch
  • Code Coverage
    • Use pytest-cov (Coverage.py under the hood)