mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Capture portable path serialization in a struct (#5652)
## Summary I need to reuse this in #5494, so want to abstract it out and make it reusable.
This commit is contained in:
parent
8d14a4cb4f
commit
dfec262586
9 changed files with 169 additions and 79 deletions
|
@ -26,7 +26,6 @@ uv-installer = { workspace = true }
|
|||
|
||||
dirs-sys = { workspace = true }
|
||||
fs-err = { workspace = true }
|
||||
path-slash = { workspace = true }
|
||||
pathdiff = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use path_slash::PathBufExt;
|
||||
use pypi_types::VerbatimParsedUrl;
|
||||
use serde::Deserialize;
|
||||
use toml_edit::value;
|
||||
use toml_edit::Array;
|
||||
use toml_edit::Table;
|
||||
use toml_edit::Value;
|
||||
|
||||
use pypi_types::VerbatimParsedUrl;
|
||||
use uv_fs::PortablePath;
|
||||
|
||||
/// A tool entry.
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
|
||||
|
@ -127,7 +128,7 @@ impl ToolEntrypoint {
|
|||
table.insert(
|
||||
"install-path",
|
||||
// Use cross-platform slashes so the toml string type does not change
|
||||
value(self.install_path.to_slash_lossy().to_string()),
|
||||
value(PortablePath::from(&self.install_path).to_string()),
|
||||
);
|
||||
table
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue