1
"""Information about the workspace for wini build scripts."""
10
"""Returns the hash of the current Git commit."""
11
return subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("utf-8").strip()
15
"""A possible operating system to build for."""
23
"""A possible architecture to build for."""
30
def target_osarch() -> (OS, Arch):
31
"""Returns the target platform."""
32
sys = _parse_current_os()
34
# cibuildwheel builds on an x86_64 Mac when targeting ARM64.
35
# It sets an undocumented "PLAT" environment variable which we use
36
# to detect this case (potential improvement: use a command-line argument
37
# to the build system instead).
38
if sys == OS.DARWIN and os.getenv("PLAT", "").endswith("arm64"):
41
arch = _parse_current_arch()
47
"""Returns the target operating system."""
48
(os, _) = target_osarch()
52
def _parse_current_os() -> OS:
53
"""Extracts the current operating system."""
54
sys = platform.system().lower()
63
def _parse_current_arch() -> Arch:
64
"""Extracts the current architecture."""
65
machine = platform.machine().lower()
66
if machine in ["x86_64", "amd64", "aarch64"]:
68
elif machine == "arm64":