diff options
author | Lars Wirzenius <liw@sequoia-pgp.org> | 2022-09-21 19:48:13 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@sequoia-pgp.org> | 2022-09-21 19:48:13 +0300 |
commit | 0a90b202704226c3cb749ad24be49dedc750fdf4 (patch) | |
tree | d84e751284bacf85b938091805c7306b6c500707 | |
parent | 8483b0a1e5c4562a2ea667cc0358cc5cb00b9655 (diff) | |
download | missing-dependencies-0a90b202704226c3cb749ad24be49dedc750fdf4.tar.gz |
fix: only include build and normal dependencies
Dev deps are for running tests.
Sponsored-by: pep.foundation
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index edb8712..e1976f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use anyhow::anyhow; -use cargo_metadata::{CargoOpt, MetadataCommand}; +use cargo_metadata::{CargoOpt, DependencyKind, MetadataCommand}; use clap::Parser; use log::{debug, error, info, trace}; use semver::{Version, VersionReq}; @@ -40,7 +40,7 @@ fn fallible_main() -> anyhow::Result<()> { let mut dependencies: HashMap<String, VersionReq> = HashMap::new(); for package in metadata.packages { for dep in &package.dependencies { - if dep.target.is_none() { + if dep.target.is_none() && matches!(dep.kind, DependencyKind::Build | DependencyKind::Normal) { trace!("package {} platform {:?}", package.name, dep.target); let name = canonicalize_crate_name(&dep.name); trace!("dependency on {} {}", name, dep.req); |