Show fully-resolved URLs in non-resolution contexts (#689)

We now show the fully-resolved URL, rather than the URL as given by the
user, _everywhere_ except for the output resolution file (which should
retain relative paths, unexpanded environment variables, etc.).

Closes https://github.com/astral-sh/puffin/issues/687.
This commit is contained in:
Charlie Marsh 2023-12-18 17:10:24 -05:00 committed by GitHub
parent 43c837f7bb
commit 365c860e27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 123 additions and 39 deletions

View file

@ -10,7 +10,7 @@ use pubgrub::type_aliases::SelectedDependencies;
use rustc_hash::FxHashMap;
use url::Url;
use distribution_types::{Dist, LocalEditable, Metadata, PackageId};
use distribution_types::{Dist, LocalEditable, Metadata, PackageId, Verbatim};
use pep440_rs::Version;
use pep508_rs::{Requirement, VerbatimUrl};
use puffin_normalize::{ExtraName, PackageName};
@ -212,9 +212,9 @@ impl std::fmt::Display for ResolutionGraph {
// Print out the dependency graph.
for (index, package) in nodes {
if let Some((editable, _)) = self.editables.get(package.name()) {
writeln!(f, "-e {editable}")?;
writeln!(f, "-e {}", editable.verbatim())?;
} else {
writeln!(f, "{package}")?;
writeln!(f, "{}", package.verbatim())?;
}
let mut edges = self