|
9 | 9 |
|
10 | 10 | def get_platform(): |
11 | 11 | system = platform.system() |
12 | | - machine = platform.machine() |
| 12 | + is_arm64 == platform.machine() in ("arm64", "aarch64") |
13 | 13 | if system == "Linux": |
14 | 14 | if platform.libc_ver()[0] == "glibc": |
15 | | - return f"manylinux_{machine}" |
| 15 | + return "manylinux-aarch64" if is_arm64 else "manylinux-x86_64" |
16 | 16 | else: |
17 | | - return f"musllinux_{machine}" |
| 17 | + return "musllinux-aarch64" if is_arm64 else "musllinux-x86_64" |
18 | 18 | elif system == "Darwin": |
19 | | - # cibuildwheel sets ARCHFLAGS: |
20 | | - # https://github.com/pypa/cibuildwheel/blob/5255155bc57eb6224354356df648dc42e31a0028/cibuildwheel/macos.py#L207-L220 |
21 | | - if "ARCHFLAGS" in os.environ: |
22 | | - machine = os.environ["ARCHFLAGS"].split()[1] |
23 | | - return f"macosx_{machine}" |
| 19 | + return "macos-arm64" if is_arm64 else "macos-x86_64" |
24 | 20 | elif system == "Windows": |
25 | | - if struct.calcsize("P") * 8 == 64: |
26 | | - return "win_amd64" |
27 | | - else: |
28 | | - return "win32" |
| 21 | + return "windows-aarch64" if is_arm64 else "windows-x86_64" |
29 | 22 | else: |
30 | | - raise Exception(f"Unsupported system {system}") |
| 23 | + return "unknown" |
31 | 24 |
|
32 | 25 |
|
33 | 26 | parser = argparse.ArgumentParser(description="Fetch and extract tarballs") |
@@ -58,6 +51,5 @@ def get_platform(): |
58 | 51 | ["curl", "--location", "--output", tarball_file, "--silent", tarball_url] |
59 | 52 | ) |
60 | 53 |
|
61 | | -# extract tarball |
62 | 54 | logging.info(f"Extracting {tarball_name}") |
63 | 55 | subprocess.check_call(["tar", "-C", args.destination_dir, "-xf", tarball_file]) |
0 commit comments