From f40da39bafd375a549df4324d302d3257481c3c7 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 25 Dec 2024 15:23:39 -0500 Subject: [PATCH] Store absolute paths in PEP 723 scripts (#10161) --- crates/uv-scripts/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/uv-scripts/src/lib.rs b/crates/uv-scripts/src/lib.rs index 8b46007e0be8..e5a992e61b8a 100644 --- a/crates/uv-scripts/src/lib.rs +++ b/crates/uv-scripts/src/lib.rs @@ -95,7 +95,7 @@ impl Pep723Script { let metadata = Pep723Metadata::from_str(&metadata)?; Ok(Some(Self { - path: file.as_ref().to_path_buf(), + path: std::path::absolute(file)?, metadata, prelude, postlude, @@ -124,7 +124,7 @@ impl Pep723Script { let (shebang, postlude) = extract_shebang(&contents)?; Ok(Self { - path: file.as_ref().to_path_buf(), + path: std::path::absolute(file)?, prelude: if shebang.is_empty() { String::new() } else {