fix: support Python 3.14's color CLI (#2394)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
@@ -46,6 +46,8 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
python_version: '3.11'
|
python_version: '3.11'
|
||||||
|
- os: ubuntu-latest
|
||||||
|
python_version: '3.14'
|
||||||
timeout-minutes: 180
|
timeout-minutes: 180
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -6,12 +6,17 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import copy
|
import copy
|
||||||
|
import functools
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
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.add_argument("--schemastore", action="store_true", help="Generate schema_store version")
|
parser.add_argument("--schemastore", action="store_true", help="Generate schema_store version")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import functools
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@@ -13,7 +14,10 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
default_cpu_count = os.process_cpu_count() or 2
|
default_cpu_count = os.process_cpu_count() or 2
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
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.add_argument(
|
parser.add_argument(
|
||||||
"--run-podman", action="store_true", default=False, help="run podman tests (linux only)"
|
"--run-podman", action="store_true", default=False, help="run podman tests (linux only)"
|
||||||
)
|
)
|
||||||
|
|||||||
+5
-1
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import functools
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@@ -12,7 +13,10 @@ if __name__ == "__main__":
|
|||||||
# move cwd to the project root
|
# move cwd to the project root
|
||||||
os.chdir(Path(__file__).resolve().parents[1])
|
os.chdir(Path(__file__).resolve().parents[1])
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Runs a sample build")
|
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.add_argument("project_python_path", nargs="?", default="test.test_0_basic.basic_project")
|
parser.add_argument("project_python_path", nargs="?", default="test.test_0_basic.basic_project")
|
||||||
|
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import contextlib
|
import contextlib
|
||||||
import dataclasses
|
import dataclasses
|
||||||
|
import functools
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
@@ -79,7 +80,10 @@ def main_inner(global_options: GlobalOptions) -> None:
|
|||||||
rather than exiting directly.
|
rather than exiting directly.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
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="Build wheels for all the platforms.",
|
description="Build wheels for all the platforms.",
|
||||||
epilog="""
|
epilog="""
|
||||||
Most options are supplied via environment variables or in
|
Most options are supplied via environment variables or in
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
"Programming Language :: Python :: 3.13",
|
"Programming Language :: Python :: 3.13",
|
||||||
|
"Programming Language :: Python :: 3.14",
|
||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Topic :: Software Development :: Build Tools",
|
"Topic :: Software Development :: Build Tools",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
|
import argparse
|
||||||
|
import functools
|
||||||
import importlib
|
import importlib
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from argparse import ArgumentParser
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
parser = ArgumentParser(
|
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(
|
||||||
prog="python -m test.test_projects", description="Generate a test project to check it out"
|
prog="python -m test.test_projects", description="Generate a test project to check it out"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
|||||||
Reference in New Issue
Block a user