From 95e827ece1677af15cb86f3be46f22d200197650 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 14 Aug 2025 14:44:05 -0400 Subject: [PATCH] chore: color and suggest_on_error are now default (3.14rc1+) (#2554) Signed-off-by: Henry Schreiner --- bin/generate_schema.py | 7 +------ bin/run_tests.py | 6 +----- bin/sample_build.py | 6 +----- cibuildwheel/__main__.py | 7 ++----- 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/bin/generate_schema.py b/bin/generate_schema.py index ac720e3d..fe5f0918 100755 --- a/bin/generate_schema.py +++ b/bin/generate_schema.py @@ -6,17 +6,12 @@ import argparse import copy -import functools import json -import sys from typing import Any import yaml -make_parser = functools.partial(argparse.ArgumentParser, allow_abbrev=False) -if sys.version_info >= (3, 14): - make_parser = functools.partial(make_parser, color=True, suggest_on_error=True) -parser = make_parser() +parser = argparse.ArgumentParser(allow_abbrev=False) parser.add_argument("--schemastore", action="store_true", help="Generate schema_store version") args = parser.parse_args() diff --git a/bin/run_tests.py b/bin/run_tests.py index 4e742e44..ed315042 100755 --- a/bin/run_tests.py +++ b/bin/run_tests.py @@ -2,7 +2,6 @@ import argparse -import functools import os import subprocess import sys @@ -14,10 +13,7 @@ if __name__ == "__main__": else: default_cpu_count = os.process_cpu_count() or 2 - make_parser = functools.partial(argparse.ArgumentParser, allow_abbrev=False) - if sys.version_info >= (3, 14): - make_parser = functools.partial(make_parser, color=True, suggest_on_error=True) - parser = make_parser() + parser = argparse.ArgumentParser(allow_abbrev=False) parser.add_argument( "--run-podman", action="store_true", default=False, help="run podman tests (linux only)" ) diff --git a/bin/sample_build.py b/bin/sample_build.py index d98ce28e..b86f9724 100755 --- a/bin/sample_build.py +++ b/bin/sample_build.py @@ -2,7 +2,6 @@ import argparse -import functools import os import subprocess import sys @@ -13,10 +12,7 @@ if __name__ == "__main__": # move cwd to the project root os.chdir(Path(__file__).resolve().parents[1]) - make_parser = functools.partial(argparse.ArgumentParser, allow_abbrev=False) - if sys.version_info >= (3, 14): - make_parser = functools.partial(make_parser, color=True, suggest_on_error=True) - parser = make_parser(description="Runs a sample build") + parser = argparse.ArgumentParser(description="Runs a sample build", allow_abbrev=False) parser.add_argument("project_python_path", nargs="?", default="test.test_0_basic.basic_project") options = parser.parse_args() diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 2a4be883..69da40c9 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -1,7 +1,6 @@ import argparse import contextlib import dataclasses -import functools import os import shutil import sys @@ -80,16 +79,14 @@ def main_inner(global_options: GlobalOptions) -> None: rather than exiting directly. """ - make_parser = functools.partial(argparse.ArgumentParser, allow_abbrev=False) - if sys.version_info >= (3, 14): - make_parser = functools.partial(make_parser, color=True, suggest_on_error=True) - parser = make_parser( + parser = argparse.ArgumentParser( description="Build wheels for all the platforms.", epilog=""" Most options are supplied via environment variables or in --config-file (pyproject.toml usually). See https://github.com/pypa/cibuildwheel#options for info. """, + allow_abbrev=False, ) parser.add_argument(