liveBook · Manning

Distribution package

As explained in Python Workout, Second Edition

A distribution package is an installable Python distribution containing package code, metadata, dependencies, licensing information, and installation instructions.

A distribution package wraps a Python package for sharing and installation. It carries metadata such as author, compatible versions, licensing, tests, dependencies, and installation instructions. section 9.9

Keep the two meanings of package separate: a distribution package contains a Python package directory, often with the same name. Creating one traditionally requires setup.py; uv can configure, build, distribute, and publish packages while managing Python versions and virtual environments. section 9.9

Nested package layout

A distribution named mypackage can contain an outer mypackage directory and an inner mypackage directory holding the Python package. With __init__.py present, import mypackage loads and executes that file. section 9.9

from mypackage import first

Compare importing a package module directly with importing the package and exposing modules through __init__.py. section 9.9

How Python Workout, Second Edition covers it

How deep it goes
Distinguishes distribution and Python packages, shows their nested directories, and names setup.py without detailing its configuration.
Examples
Uses mypackage, __init__.py, and import statements to illustrate package structure and loading.
What it assumes
Assumes familiarity with Python modules and imports, while clarifying the separate meaning of distribution package.
What you can do after
Operate/configure uv to create, distribute, install, and publish Python packages while managing environments.
How it connects
Connects Python packages with modules, __init__.py, PyPI, dependencies, and virtual environments.

Also explained in

Compare how 2 books explain distribution package →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Python Workout, Second Edition. The section links point to the parts of the book it draws on.