liveBook · Manning

Dependency

As explained in Fast by Default

A dependency is an external software component that another software component requires to build or operate.

A dependency is an external software component required to build or operate another component. Dependencies accumulate as packages are added, while indirect dependencies can grow the artifact without being obvious in application code. section 8.2.2

Dependency growth affects downloads, deployments, startup, and runtime artifact size. Development-only packages such as testing, linting, and debugging tools should not remain production dependencies. section 8.2.2 section 8.6

Manage dependencies as a measurable build concern:

  • List installed and declared packages, then compare them with the imports or code that actually uses them. section 8.2.2
  • Separate development dependencies from production dependencies so package managers can exclude unnecessary tools from production builds. section 8.2.2
  • Inspect indirect dependencies and measure which packages consume the most space in the final artifact. section 8.2.2 section 8.6
  • Repeat the audit over time because unused packages accumulate after features and tools are removed. section 8.2.2

Checkout API dependency audit

A checkout API reduced its container image from 2.1GB to 340MB, then used pipreqs to compare source 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

pipreqs /path/to/your/project --savepath requirements-actual.txt

Run pipreqs to generate a requirements file from actual imports, then compare it with the declared dependency file. section 8.2.2

How Fast by Default covers it

How deep it goes
Explains accumulation, indirect dependencies, classification, measurement, and removal, but does not detail dependency resolution internals.
Examples
Uses a checkout API audit, pipreqs, requirements files, container images, and dependency-size inspection.
What it assumes
Assumes source code, declared dependency files, and enough package-manager knowledge to compare imports with installed packages.
What you can do after
Diagnose/debug with pipreqs and package-manager reports, remove unused dependencies, and reduce production artifact size.
How it connects
Connects dependencies with package managers, indirect dependencies, production builds, container images, and build artifacts.

Also explained in

Compare how 35 books explain 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.