feat: Print FatalError messages using Logger (#2292)
* feat: Print FatalError messages using Logger This makes them appear GHA annotations in CI logs, which makes them easier to spot. I've also added the "cibuildwheel: " prefix to those errors, I think it helps when viewing a log to know which tool is talking to you - it can be difficult to understand with build tools. * Nicer error message on invalid architecture * Fix some message formatting and test expectations
This commit is contained in:
@@ -8,6 +8,8 @@ from collections.abc import Set
|
||||
from enum import StrEnum, auto
|
||||
from typing import Final, Literal
|
||||
|
||||
from cibuildwheel import errors
|
||||
|
||||
from .typing import PlatformName
|
||||
|
||||
PRETTY_NAMES: Final[dict[PlatformName, str]] = {
|
||||
@@ -78,7 +80,11 @@ class Architecture(StrEnum):
|
||||
elif arch_str == "auto32":
|
||||
result |= Architecture.bitness_archs(platform=platform, bitness="32")
|
||||
else:
|
||||
result.add(Architecture(arch_str))
|
||||
try:
|
||||
result.add(Architecture(arch_str))
|
||||
except ValueError as e:
|
||||
msg = f"Invalid architecture '{arch_str}'"
|
||||
raise errors.ConfigurationError(msg) from e
|
||||
return result
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user