From 1308f2d9deeabd4ee6e30e9950649693f9c91031 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Fri, 13 Dec 2024 18:58:26 +0800 Subject: [PATCH] fix: don't fail when glibc is not found Signed-off-by: Frost Ming --- src/dep_logic/tags/platform.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/dep_logic/tags/platform.py b/src/dep_logic/tags/platform.py index 6e57af5..1a2f6c2 100644 --- a/src/dep_logic/tags/platform.py +++ b/src/dep_logic/tags/platform.py @@ -50,8 +50,8 @@ def parse(cls, platform: str) -> Self: - `windows_amd64` - `windows_x86` - `windows_arm64` - - `macos_arm64`: an alias for `macos_12_0_arm64` - - `macos_x86_64`: an alias for `macos_12_0_x86_64` + - `macos_arm64`: an alias for `macos_14_0_arm64` + - `macos_x86_64`: an alias for `macos_14_0_x86_64` - `macos_X_Y_arm64` - `macos_X_Y_x86_64` - `manylinux_X_Y_x86_64` @@ -70,9 +70,9 @@ def parse(cls, platform: str) -> Self: elif platform.startswith("windows_"): return cls(os.Windows(), Arch.parse(platform.split("_", 1)[1])) elif platform == "macos_arm64": - return cls(os.Macos(12, 0), Arch.Aarch64) + return cls(os.Macos(14, 0), Arch.Aarch64) elif platform == "macos_x86_64": - return cls(os.Macos(12, 0), Arch.X86_64) + return cls(os.Macos(14, 0), Arch.X86_64) elif (m := _platform_major_minor_re.match(platform)) is not None: os_name, major, minor, arch = m.groups() if os_name == "manylinux": @@ -130,10 +130,8 @@ def current(cls) -> Self: glibc_version = _get_glibc_version() if musl_version: os_ = os.Musllinux(musl_version[0], musl_version[1]) - elif glibc_version != (-1, -1): - os_ = os.Manylinux(glibc_version[0], glibc_version[1]) else: - raise PlatformError("Unsupported platform: libc not found") + os_ = os.Manylinux(glibc_version[0], glibc_version[1]) elif operating_system == "win": os_ = os.Windows() elif operating_system == "macosx":