Skip to content

Commit cdf685c

Browse files
committed
fix: Universal pipeline
1 parent 6cf9209 commit cdf685c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/c2pa/lib.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
logger.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+
2431
def 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":

0 commit comments

Comments
 (0)