|
14 | 14 | pip install -e . # Editable install with auto-compile |
15 | 15 | """ |
16 | 16 |
|
17 | | -import os |
18 | | -import platform |
19 | 17 | import sys |
20 | 18 |
|
21 | 19 | from setuptools import setup, find_packages |
22 | 20 | from setuptools.dist import Distribution |
23 | 21 | from wheel.bdist_wheel import bdist_wheel |
24 | 22 |
|
25 | | - |
26 | | -def get_platform_info(): |
27 | | - """ |
28 | | - Get platform-specific architecture and platform tag information. |
29 | | -
|
30 | | - Note: This is duplicated from build_ddbc.compiler to avoid circular imports |
31 | | - during fresh installs where build_ddbc isn't available yet. |
32 | | - """ |
33 | | - if sys.platform.startswith("win"): |
34 | | - arch = os.environ.get("ARCHITECTURE", "x64") |
35 | | - if isinstance(arch, str): |
36 | | - arch = arch.strip("\"'") |
37 | | - if arch in ["x86", "win32"]: |
38 | | - return "x86", "win32" |
39 | | - elif arch == "arm64": |
40 | | - return "arm64", "win_arm64" |
41 | | - else: |
42 | | - return "x64", "win_amd64" |
43 | | - elif sys.platform.startswith("darwin"): |
44 | | - return "universal2", "macosx_11_0_universal2" |
45 | | - elif sys.platform.startswith("linux"): |
46 | | - target_arch = os.environ.get("targetArch", platform.machine()) |
47 | | - libc_name, _ = platform.libc_ver() |
48 | | - is_musl = libc_name and "musl" in libc_name.lower() |
49 | | - if target_arch == "x86_64": |
50 | | - return "x86_64", "musllinux_1_2_x86_64" if is_musl else "manylinux_2_28_x86_64" |
51 | | - elif target_arch in ["aarch64", "arm64"]: |
52 | | - return "aarch64", "musllinux_1_2_aarch64" if is_musl else "manylinux_2_28_aarch64" |
53 | | - else: |
54 | | - raise OSError(f"Unsupported architecture '{target_arch}' for Linux") |
55 | | - raise OSError(f"Unsupported platform: {sys.platform}") |
| 23 | +from build_ddbc.compiler import get_platform_info |
56 | 24 |
|
57 | 25 |
|
58 | 26 | # ============================================================================= |
|
0 commit comments