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:
@@ -1256,17 +1256,11 @@ impl fmt::Display for InterpreterNotFound {
|
||||
path.user_display()
|
||||
),
|
||||
Self::ExecutableNotFoundInDirectory(directory, executable) => {
|
||||
let executable = if let Ok(relative_executable) = executable.strip_prefix(directory)
|
||||
{
|
||||
relative_executable.display()
|
||||
} else {
|
||||
executable.user_display()
|
||||
};
|
||||
write!(
|
||||
f,
|
||||
"Interpreter directory `{}` does not contain Python executable at `{}`",
|
||||
directory.user_display(),
|
||||
executable
|
||||
executable.user_display_from(directory)
|
||||
)
|
||||
}
|
||||
Self::ExecutableNotFoundInSearchPath(name) => {
|
||||
|
||||
Reference in New Issue
Block a user