refactor: pull repr out of BuildOptions
This commit is contained in:
@@ -406,8 +406,7 @@ def print_preamble(platform: str, build_options: BuildOptions) -> None:
|
|||||||
|
|
||||||
print("Build options:")
|
print("Build options:")
|
||||||
print(f" platform: {platform!r}")
|
print(f" platform: {platform!r}")
|
||||||
for option, value in sorted(build_options._asdict().items()):
|
print(textwrap.indent(str(build_options), " "))
|
||||||
print(f" {option}: {value!r}")
|
|
||||||
|
|
||||||
warnings = detect_warnings(platform, build_options)
|
warnings = detect_warnings(platform, build_options)
|
||||||
if warnings:
|
if warnings:
|
||||||
|
|||||||
@@ -225,6 +225,10 @@ class BuildOptions(NamedTuple):
|
|||||||
build_verbosity: int
|
build_verbosity: int
|
||||||
build_frontend: BuildFrontend
|
build_frontend: BuildFrontend
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
res = (f"{option}: {value!r}" for option, value in sorted(self._asdict().items()))
|
||||||
|
return "\n".join(res)
|
||||||
|
|
||||||
|
|
||||||
class NonPlatformWheelError(Exception):
|
class NonPlatformWheelError(Exception):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user