Python dependency footprint

Know what your dependencies cost.

uv-packsize installs a package set in an isolated environment, measures the files each distribution owns, and turns the result into a reviewable size budget.

Measure installed bytes

Reports logical bytes after installation, not compressed wheel size. The Python interpreter, virtualenv scaffold, and uv cache are excluded.

Explain the total

See distributions, file categories, dependency paths, and root contributions to understand why a footprint changed.

Keep CI honest

Compare a locked project with a baseline and fail a build when a total or increase exceeds its budget.

Quick start

Run it directly with uv.

No installation ceremony. uvx fetches and runs the CLI for you.

uvx uv-packsize requests

Alpha note: uv deliberately keeps pre-releases out of its default resolution. Try the current alpha explicitly with uvx --prerelease=allow uv-packsize requests. After the next stable release, the shorter command above selects it automatically.

For a repeatable, installed command:

uv tool install uv-packsize
uv-packsize requests

Inspect a result

Start broad, then ask why.

uvx uv-packsize apache-airflow==3.0.0
uvx uv-packsize requests --breakdown --explain
uvx uv-packsize requests --json > analysis.json

The text report is designed for people; versioned JSON is for comparisons and automation. Source builds are disabled by default. Use --allow-build only for sources you trust.

Locked projects

Measure the dependency set your project actually chose.

uvx uv-packsize \
  --project pyproject.toml \
  --lockfile uv.lock \
  --group test \
  --json > analysis.json

This mode validates and snapshots explicit inputs, then runs a private locked sync. It measures selected dependencies only: the local root project is deliberately not built or measured.

CI budgets

Make growth visible in every review.

uvx uv-packsize \
  --project pyproject.toml --lockfile uv.lock \
  --baseline .ci/uv-packsize-baseline.json \
  --budget-config pyproject.toml \
  --comparison-json > comparison.json

Commit the reviewed baseline and budget policy. A violation exits with status 5, so the command fits naturally into GitHub Actions and other CI systems.

Copy the GitHub Actions example →

Good to know

What the number means.