Use a cross-platform representation for relative paths in pip compile (#3804)
## Summary I haven't tested on Windows yet, but the idea here is that we should use a portable representation when printing paths. I decided to limit the scope here to paths that we write to output files. Closes https://github.com/astral-sh/uv/issues/3800.
This commit is contained in:
@@ -22,17 +22,17 @@ impl std::fmt::Display for SourceAnnotation {
|
||||
match self {
|
||||
Self::Requirement(origin) => match origin {
|
||||
RequirementOrigin::File(path) => {
|
||||
write!(f, "-r {}", path.user_display())
|
||||
write!(f, "-r {}", path.portable_display())
|
||||
}
|
||||
RequirementOrigin::Project(path, project_name) => {
|
||||
write!(f, "{project_name} ({})", path.user_display())
|
||||
write!(f, "{project_name} ({})", path.portable_display())
|
||||
}
|
||||
},
|
||||
Self::Constraint(origin) => {
|
||||
write!(f, "-c {}", origin.path().user_display())
|
||||
write!(f, "-c {}", origin.path().portable_display())
|
||||
}
|
||||
Self::Override(origin) => {
|
||||
write!(f, "--override {}", origin.path().user_display())
|
||||
write!(f, "--override {}", origin.path().portable_display())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user