Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 38 ยท Getting Started

The Python Tooling Landscape

A clear map of pip, venv, uv, pipx, Poetry, Hatch, PDM, setuptools and friends: what each does, how they overlap, and how to choose for your project.

Ask five Python developers how they manage projects and you may get five answers: pip and venv, Poetry, uv, Hatch, PDM, conda. The variety is not chaos. It is a stack of separate jobs, and tools differ mainly in how many jobs they bundle. Once you see the layers, choosing is easy.

The jobs

Think of packaging as seven jobs:

  1. Python versions: get the right interpreter.
  2. Environments: isolate site-packages per project.
  3. Install: fetch and unpack distributions.
  4. Resolve and lock: choose compatible versions and record them.
  5. Project metadata: describe the project (pyproject.toml).
  6. Build: turn the source tree into wheel and sdist (a build backend).
  7. Publish: upload to an index.

The seven packaging jobs

Python versions Pick an interpreter
Environments Isolate each project
Install Fetch and unpack
Lock Pin exact versions

Jobs 1 to 4 are about using packages.

1 / 2

The main tools and what they cover

Tool Versions Env Install Lock Metadata Build Publish
pip no no yes no (freeze) no via pip wheel no
venv / virtualenv no yes no no no no no
pipx no yes (per app) yes (apps) no no no no
pip-tools no no yes yes no no no
uv yes yes yes yes edits it yes yes
Poetry via plugin/env yes yes yes own + PEP 621 yes yes
PDM yes yes yes yes PEP 621 yes yes
Hatch yes yes via pip/uv optional PEP 621 yes (hatchling) yes
build no temp no no no yes (frontend) no
twine no no no no no no yes
setuptools, hatchling, flit-core, pdm-backend, maturin backend
conda / mamba yes yes yes (not PyPI wheels) yes own no no

A table like this is perfect for a little code: describe tools as data and query it.

Python A tool picker built from the table

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Two big ideas that organize the rest

Frontends and backends

A build frontend (pip, build, uv build) is the command you run. A build backend (setuptools.build_meta, hatchling.build, flit_core.buildapi, pdm.backend, maturin) is the library that actually creates the wheel. They talk through a small, standard interface (PEP 517), and the project's pyproject.toml names the backend. This is why you can change tools without rewriting everything: the frontend does not care which backend builds.

flowchart LR
    A["Frontend<br/>pip / build / uv"] -- "PEP 517 hooks" --> B["Backend<br/>hatchling / setuptools / flit"]
    B --> C["wheel / sdist"]
    D["pyproject.toml<br/>[build-system]"] -. "names the backend" .-> A

Frontends are interchangeable; the backend is declared by the project.

Libraries versus applications

A library is imported by others and is published to an index. It should declare loose ranges and build wheels. An application is run: a web service, a command-line tool or a data pipeline. It needs a reproducible, locked set of versions and is usually deployed as a container or installed with pipx or uv tool. Many tooling arguments dissolve when you say which of the two you are building.

Choosing: a practical guide

  • Learning, scripts, small projects: venv and pip. They are always available, and everything else builds on them.
  • A modern default for new projects: uv. It is a single fast tool for versions, environments, locking, building and publishing, and it follows the standards (PEP 621 metadata, standard lock handling via uv.lock).
  • You like an integrated all-in-one with long history: Poetry or PDM. Both are mature; Poetry has its own dependency file layout plus PEP 621 in recent versions, PDM follows the standards from the start.
  • Many test and lint environments per project: Hatch's environment matrix is excellent for that.
  • Command-line tools you use (not develop): pipx install or uv tool install keep each tool in its own environment.
  • Compiled/scientific stacks with non-Python dependencies (CUDA, GDAL): conda or mamba, possibly with pip inside.
  • A build backend: hatchling or flit-core for pure Python, setuptools for legacy or C extensions, maturin for Rust, scikit-build-core for CMake.

The ecosystem changes quickly. Names and defaults will keep shifting, but the seven jobs and the standard files (pyproject.toml, wheels, sdists) are stable. Learn those, and tool changes become a small detour instead of a rewrite.

Standards you can rely on

Whatever tool you choose, these formats stay the same, so a project made with one can usually be opened by another:

  • pyproject.toml with [build-system] and [project].
  • Wheels and sdists as the distribution formats.
  • Requirement strings and version rules (PEP 508, PEP 440).
  • Dependency groups ([dependency-groups], PEP 735) for development-only dependencies.
  • Inline script metadata (PEP 723): a comment block at the top of a single script listing its dependencies, which uv run and pipx run honor.
Python Reading PEP 723 inline script metadata

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the difference between a build frontend and a build backend?

    PEP 517 separates them. pyproject.toml names the backend so any frontend can drive it.
  2. 2. You are building a web service that must deploy identically every time. Which approach fits best?

    Applications need reproducibility, so lock exact versions and install them in an isolated environment.
  3. 3. Which tool is best suited to installing a command-line program you only want to USE, isolated from other tools?

    pipx and uv tool give each application its own environment and expose its command on your PATH.
  4. 4. What does PEP 723 inline metadata let a single script declare?

    A '# /// script' block holds TOML with requires-python and dependencies, which tools like uv run and pipx run read.

Summary

  • Packaging splits into seven jobs; tools differ in how many they bundle.
  • pip + venv are the universal baseline; uv is a fast all-in-one; Poetry, PDM and Hatch are integrated alternatives.
  • Frontends (pip, build, uv build) and backends (hatchling, setuptools, flit-core...) are separate through PEP 517.
  • Libraries declare ranges; applications lock exact versions.
  • The standard files stay stable across tools: pyproject.toml, wheels, sdists, PEP 508 requirements.

Next: Why Virtual Environments?