Shouldn't an edge to any dependency to a dev dependency of a project be a dev_only edge? However, this API, guppy::graph::PackageLink::dev_only, returns false for such an edge. In this way, I am not sure how this API is different from guppy::graph::PackageLink::dev()::is_present().
For example, for a test crate that has guppy as a dev dependency and no other dependency specified in the crate to make sure guppy doesn't appear elsewhere in the dep-graph, below code
// The crate has a single dependency, `guppy` as a dev-dependency
let pkg = graph.packages().find(|p| p.name() == "guppy").unwrap();
for link in pkg.direct_links_directed(DependencyDirection::Forward){
println!("{:?}, {:?}, {:?}, {:?}",
link.to().name(), link.normal().is_present(),
link.dev().is_present(), link.dev_only());
}
outputs:
running 1 test
"target-spec", true, false, false
"supercow", true, false, false
"serde_json", true, false, false
"serde", true, false, false
"semver", true, false, false
"petgraph", true, false, false
"pathdiff", true, false, false
"once_cell", true, false, false
"nested", true, false, false
"itertools", true, false, false
"indexmap", true, false, false
"fixedbitset", true, false, false
"cargo_metadata", true, false, false
"camino", true, false, false
However, guppy::graph::PackageLink::dev_only in its description says:
Return true if this edge is dev-only, i.e. code from this edge will not be included in normal builds.
Below is how my test crate looked like:
[dependencies]
[build-dependencies]
[dev-dependencies]
guppy = "0.9.0"
Shouldn't an edge to any dependency to a dev dependency of a project be a
dev_onlyedge? However, this API,guppy::graph::PackageLink::dev_only, returnsfalsefor such an edge. In this way, I am not sure how this API is different fromguppy::graph::PackageLink::dev()::is_present().For example, for a test crate that has
guppyas a dev dependency and no other dependency specified in the crate to make sureguppydoesn't appear elsewhere in the dep-graph, below codeoutputs:
However,
guppy::graph::PackageLink::dev_onlyin its description says:Below is how my test crate looked like: