Skip to content

Commit

Permalink
Show resolution diagnostics after pip install (#2829)
Browse files Browse the repository at this point in the history
## Summary

These are shown in `pip compile`, but absent from `pip install`.

See: #2828.
  • Loading branch information
charliermarsh committed Apr 5, 2024
1 parent 2ac562b commit 2f386ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/uv/src/commands/pip_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,17 @@ async fn resolve(
.dimmed()
)?;

// Notify the user of any diagnostics.
for diagnostic in resolution.diagnostics() {
writeln!(
printer.stderr(),
"{}{} {}",
"warning".yellow().bold(),
":".bold(),
diagnostic.message().bold()
)?;
}

Ok(resolution)
}

Expand Down
2 changes: 2 additions & 0 deletions crates/uv/tests/pip_install_scenarios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ fn missing_extra() {
----- stderr -----
Resolved 1 package in [TIME]
warning: The package `package-a==1.0.0` does not have an extra named `extra`.
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ package-a==1.0.0
Expand Down Expand Up @@ -1080,6 +1081,7 @@ fn extra_does_not_exist_backtrack() {
----- stderr -----
Resolved 1 package in [TIME]
warning: The package `package-a==3.0.0` does not have an extra named `extra`.
Downloaded 1 package in [TIME]
Installed 1 package in [TIME]
+ package-a==3.0.0
Expand Down

0 comments on commit 2f386ef

Please sign in to comment.