Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -1,9 +1,9 @@
from abc import abstractmethod
from distutils.dist import Distribution
from typing import Any, Callable, Iterable, List, Optional, Tuple, Union
from typing import Any, Callable, Iterable, List, Tuple
class Command:
sub_commands: List[Tuple[str, Optional[Callable[[Command], bool]]]]
sub_commands: List[Tuple[str, Callable[[Command], bool] | None]]
def __init__(self, dist: Distribution) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
@@ -13,18 +13,18 @@ class Command:
def run(self) -> None: ...
def announce(self, msg: str, level: int = ...) -> None: ...
def debug_print(self, msg: str) -> None: ...
def ensure_string(self, option: str, default: Optional[str] = ...) -> None: ...
def ensure_string_list(self, option: Union[str, List[str]]) -> None: ...
def ensure_string(self, option: str, default: str | None = ...) -> None: ...
def ensure_string_list(self, option: str | List[str]) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
def set_undefined_options(self, src_cmd: str, *option_pairs: Tuple[str, str]) -> None: ...
def get_finalized_command(self, command: str, create: int = ...) -> Command: ...
def reinitialize_command(self, command: Union[Command, str], reinit_subcommands: int = ...) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: int = ...) -> Command: ...
def run_command(self, command: str) -> None: ...
def get_sub_commands(self) -> List[str]: ...
def warn(self, msg: str) -> None: ...
def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Optional[str] = ..., level: int = ...) -> None: ...
def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: str | None = ..., level: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def copy_file(
self,
@@ -32,7 +32,7 @@ class Command:
outfile: str,
preserve_mode: int = ...,
preserve_times: int = ...,
link: Optional[str] = ...,
link: str | None = ...,
level: Any = ...,
) -> Tuple[str, bool]: ... # level is not used
def copy_tree(
@@ -50,18 +50,18 @@ class Command:
self,
base_name: str,
format: str,
root_dir: Optional[str] = ...,
base_dir: Optional[str] = ...,
owner: Optional[str] = ...,
group: Optional[str] = ...,
root_dir: str | None = ...,
base_dir: str | None = ...,
owner: str | None = ...,
group: str | None = ...,
) -> str: ...
def make_file(
self,
infiles: Union[str, List[str], Tuple[str]],
infiles: str | List[str] | Tuple[str],
outfile: str,
func: Callable[..., Any],
args: List[Any],
exec_msg: Optional[str] = ...,
skip_msg: Optional[str] = ...,
exec_msg: str | None = ...,
skip_msg: str | None = ...,
level: Any = ...,
) -> None: ... # level is not used