|
1 | 1 | import argparse |
2 | 2 | import os |
3 | | -from typing import List, Union |
| 3 | +from typing import List, Optional # noqa: F401 |
4 | 4 |
|
5 | 5 | from cfbs import commands |
6 | 6 | from cfbs.utils import cache, CFBSExitError |
|
9 | 9 | class ArgsTypesNamespace(argparse.Namespace): |
10 | 10 | """Manual type hints to args attributes""" |
11 | 11 |
|
12 | | - command: Union[str, None] |
13 | | - args: List[str] |
14 | | - loglevel: str |
15 | | - manual: bool |
16 | | - version: bool |
17 | | - force: bool |
18 | | - non_interactive: bool |
19 | | - index: Union[str, None] |
20 | | - check: bool |
21 | | - checksum: Union[str, None] |
22 | | - keep_order: bool |
23 | | - git: Union[bool, None] |
24 | | - git_user_name: Union[str, None] |
25 | | - git_user_email: Union[str, None] |
26 | | - git_commit_message: Union[str, None] |
27 | | - ignore_versions_json: bool |
28 | | - omit_download: bool |
29 | | - check_against_git: bool |
30 | | - minimum_version: Union[str, None] |
31 | | - to_json: Union[str, None] |
32 | | - reference_version: Union[str, None] |
33 | | - masterfiles_dir: Union[str, None] |
34 | | - ignored_path_components: List[str] |
35 | | - offline: bool |
36 | | - masterfiles: Union[str, None] |
| 12 | + # PEP 484 style type hints for compatibility with Python 3.5. |
| 13 | + # This commit can be reverted, and type hints returned to the PEP 526 style type hints, once the supported Python version becomes 3.6+. |
| 14 | + command = None # type: Optional[str] |
| 15 | + args = [] # type: List[str] |
| 16 | + loglevel = "warning" # type: str |
| 17 | + manual = False # type: bool |
| 18 | + version = False # type: bool |
| 19 | + force = False # type: bool |
| 20 | + non_interactive = False # type: bool |
| 21 | + index = None # type: Optional[str] |
| 22 | + check = False # type: bool |
| 23 | + checksum = None # type: Optional[str] |
| 24 | + keep_order = False # type: bool |
| 25 | + git = None # type: Optional[bool] |
| 26 | + git_user_name = None # type: Optional[str] |
| 27 | + git_user_email = None # type: Optional[str] |
| 28 | + git_commit_message = None # type: Optional[str] |
| 29 | + ignore_versions_json = False # type: bool |
| 30 | + omit_download = False # type: bool |
| 31 | + check_against_git = False # type: bool |
| 32 | + minimum_version = None # type: Optional[str] |
| 33 | + to_json = None # type: Optional[str] |
| 34 | + reference_version = None # type: Optional[str] |
| 35 | + masterfiles_dir = None # type: Optional[str] |
| 36 | + ignored_path_components = None # type: Optional[List[str]] |
| 37 | + offline = False # type: bool |
| 38 | + masterfiles = None # type: Optional[str] |
37 | 39 |
|
38 | 40 |
|
39 | 41 | def get_args(): |
|
0 commit comments