File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 2121logger .addHandler (logging .NullHandler ())
2222
2323
24+ class CPUArchitecture (Enum ):
25+ """CPU architecture enum for platform-specific identifiers."""
26+ AARCH64 = "aarch64"
27+ X86_64 = "x86_64"
28+ ARM64 = "arm64"
29+
30+
2431def get_platform_identifier () -> str :
2532 """Get the platform identifier (arch-os) for the current system,
2633 matching the downloaded identifiers used by the Github publisher.
@@ -38,7 +45,7 @@ def get_platform_identifier() -> str:
3845 elif system == "windows" :
3946 return "x86_64-pc-windows-msvc"
4047 elif system == "linux" :
41- if _get_architecture () in ['arm64' , 'aarch64' ]:
48+ if _get_architecture () in [CPUArchitecture . ARM64 , CPUArchitecture . AARCH64 ]:
4249 return "aarch64-unknown-linux-gnu"
4350 return "x86_64-unknown-linux-gnu"
4451 else :
@@ -55,9 +62,9 @@ def _get_architecture() -> str:
5562 if sys .platform == "darwin" :
5663 # On macOS, we need to check if we're running under Rosetta
5764 if platform .processor () == 'arm' :
58- return 'arm64'
65+ return CPUArchitecture . ARM64
5966 else :
60- return 'x86_64'
67+ return CPUArchitecture . ARM64 . X86_64
6168 elif sys .platform == "linux" :
6269 return platform .machine ()
6370 elif sys .platform == "win32" :
You can’t perform that action at this time.
0 commit comments