Fix lints

This commit is contained in:
Hood Chatham
2023-04-07 13:56:49 -07:00
parent 2f3949953a
commit 0036ac5254
+10 -11
View File
@@ -173,7 +173,7 @@ def main() -> None:
log.warning(f"Can't delete temporary folder '{temp_dir}'") log.warning(f"Can't delete temporary folder '{temp_dir}'")
def _compute_platform_only(only: str) -> str: def _compute_platform_only(only: str) -> PlatformName:
if "linux_" in only: if "linux_" in only:
return "linux" return "linux"
if "macosx_" in only: if "macosx_" in only:
@@ -187,7 +187,7 @@ def _compute_platform_only(only: str) -> str:
sys.exit(2) sys.exit(2)
def _compute_platform_ci() -> str: def _compute_platform_ci() -> PlatformName:
if detect_ci_provider() is None: if detect_ci_provider() is None:
print( print(
textwrap.dedent( textwrap.dedent(
@@ -203,16 +203,17 @@ def _compute_platform_ci() -> str:
sys.exit(2) sys.exit(2)
if sys.platform.startswith("linux"): if sys.platform.startswith("linux"):
return "linux" return "linux"
if sys.platform == "darwin": elif sys.platform == "darwin":
return "macos" return "macos"
elif sys.platform == "win32": elif sys.platform == "win32":
return "windows" return "windows"
print( else:
'cibuildwheel: Unable to detect platform from "sys.platform" in a CI environment. You can run ' print(
"cibuildwheel using the --platform argument. Check --help output for more information.", 'cibuildwheel: Unable to detect platform from "sys.platform" in a CI environment. You can run '
file=sys.stderr, "cibuildwheel using the --platform argument. Check --help output for more information.",
) file=sys.stderr,
sys.exit(2) )
sys.exit(2)
def _compute_platform(args: CommandLineArguments) -> PlatformName: def _compute_platform(args: CommandLineArguments) -> PlatformName:
@@ -235,7 +236,6 @@ def _compute_platform(args: CommandLineArguments) -> PlatformName:
print(f"cibuildwheel: Unsupported platform: {platform_option_value}", file=sys.stderr) print(f"cibuildwheel: Unsupported platform: {platform_option_value}", file=sys.stderr)
sys.exit(2) sys.exit(2)
if args.only: if args.only:
return _compute_platform_only(args.only) return _compute_platform_only(args.only)
elif platform_option_value != "auto": elif platform_option_value != "auto":
@@ -244,7 +244,6 @@ def _compute_platform(args: CommandLineArguments) -> PlatformName:
return _compute_platform_ci() return _compute_platform_ci()
def build_in_directory(args: CommandLineArguments) -> None: def build_in_directory(args: CommandLineArguments) -> None:
platform: PlatformName = _compute_platform(args) platform: PlatformName = _compute_platform(args)
options = compute_options(platform=platform, command_line_arguments=args, env=os.environ) options = compute_options(platform=platform, command_line_arguments=args, env=os.environ)