Metadata-Version: 2.4
Name: astral-dev-toolchain-cargo-depgraph
Version: 1.6.0
Summary: Creates dependency graphs for cargo projects using `cargo metadata` and graphviz.
Home-Page: https://sr.ht/~jplatte/cargo-depgraph/
Maintainer-email: Astral <hey@astral.sh>
License: GPL-3.0-or-later
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://sr.ht/~jplatte/cargo-depgraph/
Project-URL: Source Code, https://git.sr.ht/~jplatte/cargo-depgraph

> **Build provenance:** This package is built and distributed by [Astral](https://astral.sh) as part of [`astral-dev-toolchain`](https://github.com/astral-sh/astral-dev-toolchain).
> It packages [`cargo-depgraph`](https://codeberg.org/jplatte/cargo-depgraph) from tag `v1.6.0` at commit `1e5f6142637230e8128f559b23daf43e1d407c07`.

---

# cargo-depgraph

Creates dependency graphs for cargo projects using `cargo metadata` and graphviz.

## Installation

`cargo install cargo-depgraph`

If you are using Arch Linux, you can alternatively install via `pacman -S cargo-depgraph`.

## Usage

*Note: This assumes you have [Graphviz](https://graphviz.org/) installed. There are also online
tools that can generate graphics from the textual graphviz graphs `cargo depgraph` generates, if
the command-line graphviz tools like `dot` aren't your thing.*

`cargo depgraph [options] | dot -Tpng > graph.png`

The full list of options can be seen by running

`cargo depgraph --help`

Commonly useful options:

* `--all-deps`

![cargo-depgraph's dependency graph](graph_all.png)

* `--all-deps --dedup-transitive-deps`

![cargo-depgraph's dependency graph with transitive dependency edges de-duplicated](graph_all_deduped.png)

## Output explanation

* square node = root / workspace member
* grey background = target-specific dependency
* dotted lines = optional dependency (could be removed by disabling a cargo feature)
* dashed lines = transitively optional dependency (could be removed by removing one of the dotted
  edges)
* line colors = dependency kinds w.r.t. root / workspace members
  * black = normal
  * blue = dev-dependency
  * green = build-dependency
  * light turquoise = build-dependency of a dev-dependency
  * dark green = both normal and build-dependency
  * violet = both dev-dependency and build-dependency
  * … not seen in the wild yet, but theoretically possible:
    * dark turquoise = both normal and build-dependency of a dev-dependency
    * pastel blue = both dev-dependency and build-dependency of a dev-dependency
  * red = you broke it

