liveBook · Manning

Production dependency

As explained in Fast by Default

A production dependency is a package required by an application in its deployed runtime environment.

A production dependency is a package required by an application in its deployed runtime environment. Unlike testing frameworks, linters, and debugging utilities, it contributes directly to the running application and belongs in the production dependency set. section 8.2.2

Keep production dependencies accurate and bounded:

  • List installed packages and compare them with imports used by application code. section 8.2.2
  • Remove unused packages and recategorize development tools so package managers can exclude them from production builds. section 8.2.2
  • Pin resolved versions and repeat the analysis over time to prevent dependency accumulation. section 8.2.2

Checkout API cleanup

After reducing its container image to 340MB, a checkout API team used pipreqs to compare imports with 23 declared dependencies. Eight unused or development-only packages were removed, along with their indirect dependencies, cutting another 40MB. section 8.2.2

How Fast by Default covers it

How deep it goes
Explains dependency classification, unused-package analysis, Python tooling, and version pinning, but does not detail package-manager internals.
Examples
Uses a checkout API, a 340MB container image, 23 declared packages, eight removals, and a further 40MB reduction.
What it assumes
Assumes familiarity with application packages and dependency files while defining the runtime-versus-development distinction.
What you can do after
Diagnose production bloat with pipreqs, remove unused packages, and pin the remaining dependency set.
How it connects
Connects production dependencies with container images, indirect dependencies, package managers, multi-stage builds, and base image selection.

Also explained in

Compare how 2 books explain production dependency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.