Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle renamed Rust dependency in sdist #1728

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,21 +546,19 @@ fn find_path_deps(cargo_metadata: &Metadata) -> Result<HashMap<String, PathBuf>>
while let Some(top) = stack.pop() {
for dependency in &top.dependencies {
if let Some(path) = &dependency.path {
let dep_name = dependency.rename.as_ref().unwrap_or(&dependency.name);
if matches!(dependency.kind, cargo_metadata::DependencyKind::Development) {
// Skip dev-only dependency
debug!(
"Skipping development only dependency {} ({})",
dependency.name, path
dep_name, path
);
continue;
}
// we search for the respective package by `manifest_path`, there seems
// to be no way to query the dependency graph given `dependency`
let dep_manifest_path = path.join("Cargo.toml");
path_deps.insert(
dependency.name.clone(),
PathBuf::from(dep_manifest_path.clone()),
);
path_deps.insert(dep_name.clone(), PathBuf::from(dep_manifest_path.clone()));
if let Some(dep_package) = cargo_metadata
.packages
.iter()
Expand Down