|
1 | 1 | from __future__ import annotations
|
2 | 2 |
|
3 | 3 | import os
|
4 |
| -import sys |
5 | 4 | import textwrap
|
6 | 5 | import typing as t
|
7 | 6 |
|
|
24 | 23 | from .param_types import CommaDelimitedList, LazyBinaryReadFile, ValidatorClassName
|
25 | 24 | from .parse_result import ParseResult, SchemaLoadingMode
|
26 | 25 |
|
27 |
| -if sys.version_info >= (3, 8): |
28 |
| - from typing import Literal |
29 |
| -else: |
30 |
| - from typing_extensions import Literal |
31 |
| - |
32 | 26 | BUILTIN_SCHEMA_NAMES = [f"vendor.{k}" for k in SCHEMA_CATALOG.keys()] + [
|
33 | 27 | f"custom.{k}" for k in CUSTOM_SCHEMA_NAMES
|
34 | 28 | ]
|
@@ -236,13 +230,13 @@ def main(
|
236 | 230 | no_cache: bool,
|
237 | 231 | cache_filename: str | None,
|
238 | 232 | disable_formats: tuple[list[str], ...],
|
239 |
| - format_regex: Literal["python", "default"], |
240 |
| - default_filetype: Literal["json", "yaml", "toml", "json5"], |
241 |
| - traceback_mode: Literal["full", "short"], |
242 |
| - data_transform: Literal["azure-pipelines", "gitlab-ci"] | None, |
| 233 | + format_regex: t.Literal["python", "default"], |
| 234 | + default_filetype: t.Literal["json", "yaml", "toml", "json5"], |
| 235 | + traceback_mode: t.Literal["full", "short"], |
| 236 | + data_transform: t.Literal["azure-pipelines", "gitlab-ci"] | None, |
243 | 237 | fill_defaults: bool,
|
244 | 238 | validator_class: type[jsonschema.protocols.Validator] | None,
|
245 |
| - output_format: Literal["text", "json"], |
| 239 | + output_format: t.Literal["text", "json"], |
246 | 240 | verbose: int,
|
247 | 241 | quiet: int,
|
248 | 242 | instancefiles: tuple[t.IO[bytes], ...],
|
|
0 commit comments