Add defaults for third-party stubs I-L (#9955)

This commit is contained in:
Alex Waygood
2023-03-27 18:19:55 +01:00
committed by GitHub
parent 1cd3ae8e30
commit af884b236b
453 changed files with 2572 additions and 2510 deletions

View File

@@ -9,16 +9,16 @@ class Collection:
auto_dash_names: bool
def __init__(self, *args, **kwargs) -> None: ...
@classmethod
def from_module(cls, module, name=..., config=..., loaded_from=..., auto_dash_names=...): ...
def add_task(self, task, name=..., aliases=..., default=...) -> None: ...
def add_collection(self, coll, name=..., default=...) -> None: ...
def from_module(cls, module, name=None, config=None, loaded_from=None, auto_dash_names=None): ...
def add_task(self, task, name=None, aliases=None, default=None) -> None: ...
def add_collection(self, coll, name=None, default=None) -> None: ...
def subcollection_from_path(self, path): ...
def task_with_config(self, name): ...
def to_contexts(self, ignore_unknown_help: bool | None = ...): ...
def to_contexts(self, ignore_unknown_help: bool | None = None): ...
def subtask_name(self, collection_name, task_name): ...
def transform(self, name): ...
@property
def task_names(self): ...
def configuration(self, taskpath=...): ...
def configuration(self, taskpath=None): ...
def configure(self, options) -> None: ...
def serialized(self): ...

View File

@@ -4,7 +4,7 @@ def load_source(name: str, path: str) -> dict[str, Any]: ...
class DataProxy:
@classmethod
def from_data(cls, data, root=..., keypath=...): ...
def from_data(cls, data, root=None, keypath=()): ...
def __getattr__(self, key: str): ...
def __setattr__(self, key: str, value) -> None: ...
def __iter__(self): ...
@@ -30,27 +30,27 @@ class Config(DataProxy):
def global_defaults(): ...
def __init__(
self,
overrides=...,
defaults=...,
system_prefix=...,
user_prefix=...,
project_location=...,
runtime_path=...,
lazy: bool = ...,
overrides=None,
defaults=None,
system_prefix=None,
user_prefix=None,
project_location=None,
runtime_path=None,
lazy: bool = False,
) -> None: ...
def load_base_conf_files(self) -> None: ...
def load_defaults(self, data, merge: bool = ...) -> None: ...
def load_overrides(self, data, merge: bool = ...) -> None: ...
def load_system(self, merge: bool = ...) -> None: ...
def load_user(self, merge: bool = ...) -> None: ...
def load_project(self, merge: bool = ...) -> None: ...
def load_defaults(self, data, merge: bool = True) -> None: ...
def load_overrides(self, data, merge: bool = True) -> None: ...
def load_system(self, merge: bool = True) -> None: ...
def load_user(self, merge: bool = True) -> None: ...
def load_project(self, merge: bool = True) -> None: ...
def set_runtime_path(self, path) -> None: ...
def load_runtime(self, merge: bool = ...) -> None: ...
def load_runtime(self, merge: bool = True) -> None: ...
def load_shell_env(self) -> None: ...
def load_collection(self, data, merge: bool = ...) -> None: ...
def load_collection(self, data, merge: bool = True) -> None: ...
def set_project_location(self, path) -> None: ...
def merge(self) -> None: ...
def clone(self, into=...): ...
def clone(self, into=None): ...
class AmbiguousMergeError(ValueError): ...

View File

@@ -4,7 +4,7 @@ from contextlib import AbstractContextManager
from .config import Config, DataProxy
class Context(DataProxy):
def __init__(self, config: Config | None = ...) -> None: ...
def __init__(self, config: Config | None = None) -> None: ...
@property
def config(self) -> Config: ...
@config.setter
@@ -17,7 +17,7 @@ class Context(DataProxy):
def cd(self, path: str | pathlib.Path) -> AbstractContextManager[None]: ...
class MockContext(Context):
def __init__(self, config: Config | None = ..., **kwargs) -> None: ...
def __init__(self, config: Config | None = None, **kwargs) -> None: ...
def run(self, command: str, *args, **kwargs): ...
def sudo(self, command: str, *args, **kwargs): ...
def set_result_for(self, attname, command, result) -> None: ...

View File

@@ -8,7 +8,7 @@ class CollectionNotFound(Exception):
class Failure(Exception):
result: Any
reason: Any
def __init__(self, result, reason=...) -> None: ...
def __init__(self, result, reason=None) -> None: ...
def streams_for_display(self): ...
class UnexpectedExit(Failure): ...
@@ -24,11 +24,11 @@ class AuthFailure(Failure):
class ParseError(Exception):
context: Any
def __init__(self, msg, context=...) -> None: ...
def __init__(self, msg, context=None) -> None: ...
class Exit(Exception):
message: Any
def __init__(self, message=..., code=...) -> None: ...
def __init__(self, message=None, code=None) -> None: ...
@property
def code(self): ...

View File

@@ -10,7 +10,7 @@ class Executor:
collection: Collection
config: Config
core: ParseResult | None
def __init__(self, collection: Collection, config: Config | None = ..., core: ParseResult | None = ...) -> None: ...
def __init__(self, collection: Collection, config: Config | None = None, core: ParseResult | None = None) -> None: ...
def execute(self, *tasks: str | tuple[str, dict[str, Any]] | ParserContext) -> dict[Task[..., Any], Any]: ...
def normalize(self, tasks: Iterable[str | tuple[str, dict[str, Any]] | ParserContext]): ...
def dedupe(self, calls: Iterable[Call]) -> list[Call]: ...

View File

@@ -5,11 +5,11 @@ from . import Config
class Loader:
config: Config
def __init__(self, config: Config | None = ...) -> None: ...
def __init__(self, config: Config | None = None) -> None: ...
def find(self, name: str) -> tuple[str, IO[Any], str, tuple[str, str, int]]: ...
def load(self, name: str | None = ...) -> tuple[ModuleType, str]: ...
def load(self, name: str | None = None) -> tuple[ModuleType, str]: ...
class FilesystemLoader(Loader):
def __init__(self, start: str | None = ..., **kwargs: Any) -> None: ...
def __init__(self, start: str | None = None, **kwargs: Any) -> None: ...
@property
def start(self) -> str: ...

View File

@@ -12,15 +12,15 @@ class Argument:
attr_name: Any
def __init__(
self,
name=...,
names=...,
name=None,
names=(),
kind=...,
default=...,
help=...,
positional: bool = ...,
optional: bool = ...,
incrementable: bool = ...,
attr_name=...,
default=None,
help=None,
positional: bool = False,
optional: bool = False,
incrementable: bool = False,
attr_name=None,
) -> None: ...
@property
def name(self): ...
@@ -32,6 +32,6 @@ class Argument:
def value(self): ...
@value.setter
def value(self, arg) -> None: ...
def set_value(self, value, cast: bool = ...): ...
def set_value(self, value, cast: bool = True): ...
@property
def got_value(self): ...

View File

@@ -12,7 +12,7 @@ class ParserContext:
inverse_flags: Any
name: Any
aliases: Any
def __init__(self, name=..., aliases=..., args=...) -> None: ...
def __init__(self, name=None, aliases=(), args=()) -> None: ...
def add_arg(self, *args, **kwargs) -> None: ...
@property
def missing_positional_args(self): ...

View File

@@ -9,7 +9,7 @@ class Parser:
initial: Any
contexts: Any
ignore_unknown: Any
def __init__(self, contexts=..., initial=..., ignore_unknown: bool = ...) -> None: ...
def __init__(self, contexts=(), initial=None, ignore_unknown: bool = False) -> None: ...
def parse_argv(self, argv): ...
class ParseMachine:
@@ -31,7 +31,7 @@ class ParseMachine:
def switch_to_context(self, name) -> None: ...
def complete_flag(self) -> None: ...
def check_ambiguity(self, value): ...
def switch_to_flag(self, flag, inverse: bool = ...) -> None: ...
def switch_to_flag(self, flag, inverse: bool = False) -> None: ...
def see_value(self, value) -> None: ...
def see_positional_arg(self, value) -> None: ...
def error(self, msg) -> None: ...

View File

@@ -16,19 +16,19 @@ class Program:
config_class: Any
def __init__(
self,
version=...,
namespace=...,
name=...,
binary=...,
loader_class=...,
executor_class=...,
config_class=...,
binary_names=...,
version=None,
namespace=None,
name=None,
binary=None,
loader_class=None,
executor_class=None,
config_class=None,
binary_names=None,
) -> None: ...
config: Any
def create_config(self) -> None: ...
def update_config(self, merge: bool = ...) -> None: ...
def run(self, argv=..., exit: bool = ...) -> None: ...
def update_config(self, merge: bool = True) -> None: ...
def run(self, argv=None, exit: bool = True) -> None: ...
def parse_core(self, argv) -> None: ...
collection: Any
list_root: Any
@@ -66,6 +66,6 @@ class Program:
def list_flat(self) -> None: ...
def list_nested(self) -> None: ...
def list_json(self) -> None: ...
def task_list_opener(self, extra: str = ...): ...
def display_with_columns(self, pairs, extra: str = ...) -> None: ...
def task_list_opener(self, extra: str = ""): ...
def display_with_columns(self, pairs, extra: str = "") -> None: ...
def print_columns(self, tuples) -> None: ...

View File

@@ -48,7 +48,7 @@ class Runner:
command: str,
*,
asynchronous: Literal[True],
disown: Literal[False] = ...,
disown: Literal[False] = False,
dry: bool = ...,
echo: bool = ...,
echo_format: str = ...,
@@ -73,8 +73,8 @@ class Runner:
self,
command: str,
*,
asynchronous: Literal[False] = ...,
disown: Literal[False] = ...,
asynchronous: Literal[False] = False,
disown: Literal[False] = False,
dry: bool = ...,
echo: bool = ...,
echo_format: str = ...,
@@ -156,7 +156,7 @@ class Runner:
class Local(Runner):
status: Any
def __init__(self, context) -> None: ...
def should_use_pty(self, pty: bool = ..., fallback: bool = ...): ...
def should_use_pty(self, pty: bool = False, fallback: bool = True): ...
process: Any
class Result:
@@ -171,15 +171,15 @@ class Result:
hide: tuple[Literal["stdout", "stderr"], ...]
def __init__(
self,
stdout: str = ...,
stderr: str = ...,
encoding: str | None = ...,
command: str = ...,
shell: str = ...,
env=...,
exited: int = ...,
pty: bool = ...,
hide: tuple[Literal["stdout", "stderr"], ...] = ...,
stdout: str = "",
stderr: str = "",
encoding: str | None = None,
command: str = "",
shell: str = "",
env=None,
exited: int = 0,
pty: bool = False,
hide: tuple[Literal["stdout", "stderr"], ...] = (),
) -> None: ...
@property
def return_code(self) -> int: ...
@@ -188,7 +188,7 @@ class Result:
def ok(self) -> bool: ...
@property
def failed(self) -> bool: ...
def tail(self, stream: Literal["stderr", "stdout"], count: int = ...) -> str: ...
def tail(self, stream: Literal["stderr", "stdout"], count: int = 10) -> str: ...
class Promise(Result):
runner: Any
@@ -199,5 +199,5 @@ class Promise(Result):
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def normalize_hide(val, out_stream=..., err_stream=...): ...
def normalize_hide(val, out_stream=None, err_stream=None): ...
def default_encoding() -> str: ...

View File

@@ -31,18 +31,18 @@ class Task(Generic[_P, _R_co]):
def __init__(
self,
body: Callable[..., Any],
name: str | None = ...,
aliases: tuple[str, ...] = ...,
positional: Iterable[str] | None = ...,
optional: Iterable[str] = ...,
default: bool = ...,
auto_shortflags: bool = ...,
help: dict[str, str] | None = ...,
pre: Iterable[Task[..., Any] | Call] | None = ...,
post: Iterable[Task[..., Any] | Call] | None = ...,
autoprint: bool = ...,
iterable: Iterable[str] | None = ...,
incrementable: Iterable[str] | None = ...,
name: str | None = None,
aliases: tuple[str, ...] = (),
positional: Iterable[str] | None = None,
optional: Iterable[str] = (),
default: bool = False,
auto_shortflags: bool = True,
help: dict[str, str] | None = None,
pre: Iterable[Task[..., Any] | Call] | None = None,
post: Iterable[Task[..., Any] | Call] | None = None,
autoprint: bool = False,
iterable: Iterable[str] | None = None,
incrementable: Iterable[str] | None = None,
) -> None: ...
@property
def name(self): ...
@@ -54,7 +54,7 @@ class Task(Generic[_P, _R_co]):
def argspec(self, body): ...
def fill_implicit_positionals(self, positional: Iterable[str] | None) -> Iterable[str]: ...
def arg_opts(self, name: str, default: Any, taken_names: Iterable[str]) -> dict[str, Any]: ...
def get_arguments(self, ignore_unknown_help: bool | None = ...) -> list[Argument]: ...
def get_arguments(self, ignore_unknown_help: bool | None = None) -> list[Argument]: ...
@overload
def task(
@@ -100,9 +100,9 @@ class Call:
def __init__(
self,
task: Task[..., Any],
called_as: str | None = ...,
args: tuple[Any, ...] | None = ...,
kwargs: dict[str, Any] | None = ...,
called_as: str | None = None,
args: tuple[Any, ...] | None = None,
kwargs: dict[str, Any] | None = None,
) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __deepcopy__(self, memo: Any) -> Self: ...
@@ -110,6 +110,6 @@ class Call:
def make_context(self, config: Config) -> Context: ...
def clone_data(self): ...
# TODO use overload
def clone(self, into: type[Call] | None = ..., with_: dict[str, Any] | None = ...) -> Call: ...
def clone(self, into: type[Call] | None = None, with_: dict[str, Any] | None = None) -> Call: ...
def call(task: Task[..., Any], *args: Any, **kwargs: Any) -> Call: ...

View File

@@ -21,7 +21,7 @@ class ExceptionHandlingThread(threading.Thread):
def __init__(
self,
*,
group: None = ...,
group: None = None,
target: Callable[..., object] | None = ...,
name: str | None = ...,
args: Iterable[Any] = ...,