Add crate graph to contributing guide (#17062)

I share this regularly with people, we should document it.

---------

Co-authored-by: Tomasz Kramkowski <tom@astral.sh>
This commit is contained in:
konsti 2025-12-10 16:01:00 +01:00 committed by GitHub
parent a550743bed
commit caac4814df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -102,6 +102,15 @@ cargo run -- venv
cargo run -- pip install requests
```
## Crate structure
Rust does not allow circular dependencies between crates. To visualize the crate hierarchy, install
[cargo-depgraph](https://github.com/jplatte/cargo-depgraph) and graphviz, then run:
```shell
cargo depgraph --dedup-transitive-deps --workspace-only | dot -Tpng > graph.png
```
## Running inside a Docker container
Source distributions can run arbitrary code on build and can make unwanted modifications to your