Update Rust crate target-lexicon to 0.13.0 (#9729)

This commit is contained in:
renovate[bot] 2024-12-10 20:34:07 -05:00 committed by GitHub
parent 589416183f
commit 3b727b7323
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 193 additions and 182 deletions

4
Cargo.lock generated
View file

@ -3713,9 +3713,9 @@ dependencies = [
[[package]]
name = "target-lexicon"
version = "0.12.16"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
checksum = "4ff4a4048091358129767b8a200d6927f58876c8b5ea16fb7b0222d43b79bfa8"
[[package]]
name = "temp-env"

View file

@ -157,7 +157,7 @@ spdx = { version = "0.10.6" }
syn = { version = "2.0.77" }
sys-info = { version = "0.9.1" }
tar = { version = "0.4.43" }
target-lexicon = { version = "0.12.16" }
target-lexicon = { version = "0.13.0" }
tempfile = { version = "3.14.0" }
textwrap = { version = "0.16.1" }
thiserror = { version = "2.0.0" }

File diff suppressed because it is too large Load diff

View file

@ -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),

View file

@ -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"])