mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-30 23:37:24 +00:00
Update Rust crate target-lexicon to 0.13.0 (#9729)
This commit is contained in:
parent
589416183f
commit
3b727b7323
5 changed files with 193 additions and 182 deletions
File diff suppressed because it is too large
Load diff
|
@ -116,7 +116,7 @@ impl Display for Libc {
|
|||
impl Display for Os {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match &**self {
|
||||
target_lexicon::OperatingSystem::Darwin => write!(f, "macos"),
|
||||
target_lexicon::OperatingSystem::Darwin(_) => write!(f, "macos"),
|
||||
inner => write!(f, "{inner}"),
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ impl FromStr for Os {
|
|||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let inner = match s {
|
||||
"macos" => target_lexicon::OperatingSystem::Darwin,
|
||||
"macos" => target_lexicon::OperatingSystem::Darwin(None),
|
||||
_ => target_lexicon::OperatingSystem::from_str(s)
|
||||
.map_err(|()| Error::UnknownOs(s.to_string()))?,
|
||||
};
|
||||
|
@ -299,7 +299,9 @@ impl From<&uv_platform_tags::Os> for Os {
|
|||
uv_platform_tags::Os::FreeBsd { .. } => Self(target_lexicon::OperatingSystem::Freebsd),
|
||||
uv_platform_tags::Os::Haiku { .. } => Self(target_lexicon::OperatingSystem::Haiku),
|
||||
uv_platform_tags::Os::Illumos { .. } => Self(target_lexicon::OperatingSystem::Illumos),
|
||||
uv_platform_tags::Os::Macos { .. } => Self(target_lexicon::OperatingSystem::Darwin),
|
||||
uv_platform_tags::Os::Macos { .. } => {
|
||||
Self(target_lexicon::OperatingSystem::Darwin(None))
|
||||
}
|
||||
uv_platform_tags::Os::Manylinux { .. }
|
||||
| uv_platform_tags::Os::Musllinux { .. }
|
||||
| uv_platform_tags::Os::Android { .. } => Self(target_lexicon::OperatingSystem::Linux),
|
||||
|
|
|
@ -81,6 +81,15 @@ def prepare_arch(arch: dict) -> tuple[str, str]:
|
|||
return family, variant
|
||||
|
||||
|
||||
def prepare_os(os: str) -> str:
|
||||
match os:
|
||||
# Special constructors
|
||||
case "darwin":
|
||||
return "Darwin(None)"
|
||||
|
||||
return os.title()
|
||||
|
||||
|
||||
def prepare_prerelease(prerelease: str) -> str:
|
||||
if not prerelease:
|
||||
return "None"
|
||||
|
@ -91,7 +100,7 @@ def prepare_prerelease(prerelease: str) -> str:
|
|||
|
||||
|
||||
def prepare_value(value: dict) -> dict:
|
||||
value["os"] = value["os"].title()
|
||||
value["os"] = prepare_os(value["os"])
|
||||
value["arch_family"], value["arch_variant"] = prepare_arch(value["arch"])
|
||||
value["name"] = prepare_name(value["name"])
|
||||
value["libc"] = prepare_libc(value["libc"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue