Fix some stubtest complaints before they happen (#9585)

Add missing objects to various stubs
This commit is contained in:
Alex Waygood
2023-01-24 21:45:31 +00:00
committed by GitHub
parent 4148a7b73e
commit a9b4fa0a32
8 changed files with 21 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
import sys
from lib2to3.pgen2.grammar import Grammar
class Symbols:
@@ -110,4 +111,6 @@ class pattern_symbols(Symbols):
python_grammar: Grammar
python_grammar_no_print_statement: Grammar
if sys.version_info >= (3, 8):
python_grammar_no_print_and_exec_statement: Grammar
pattern_grammar: Grammar

View File

@@ -1,10 +1,11 @@
import inspect
from builtins import dict as _dict # alias to avoid conflicts with attribute name
from collections.abc import Callable, Iterator
from contextlib import _GeneratorContextManager
from inspect import Signature, getfullargspec as getfullargspec, iscoroutinefunction as iscoroutinefunction
from re import Pattern
from typing import Any, TypeVar
from typing_extensions import ParamSpec
from typing_extensions import Literal, ParamSpec
_C = TypeVar("_C", bound=Callable[..., Any])
_Func = TypeVar("_Func", bound=Callable[..., Any])
@@ -14,6 +15,7 @@ _P = ParamSpec("_P")
def get_init(cls: type) -> None: ...
DEF: Pattern[str]
POS: Literal[inspect._ParameterKind.POSITIONAL_OR_KEYWORD]
class FunctionMaker:
args: list[str]

View File

@@ -1,9 +1,12 @@
import logging
from collections.abc import Mapping, Sequence
from typing import IO, ClassVar
from typing_extensions import TypedDict
from .util import Context
logger: logging.Logger
class KeyValues(dict[str, str]):
parser_attr: ClassVar[str | None]
parser: DockerfileParser

View File

@@ -1,5 +1,8 @@
import logging
import pathlib
logger: logging.Logger
class PlaysoundException(Exception): ...
def playsound(sound: str | pathlib.Path, block: bool = ...) -> None: ...

View File

@@ -1,4 +1,5 @@
# https://pyinstaller.org/en/stable/usage.html#running-pyinstaller-from-python-code
import logging
from _typeshed import SupportsKeysAndGetItem
from collections.abc import Iterable
from typing_extensions import TypeAlias
@@ -8,4 +9,6 @@ _PyIConfig: TypeAlias = (
SupportsKeysAndGetItem[str, bool | str | list[str] | None] | Iterable[tuple[str, bool | str | list[str] | None]]
)
logger: logging.Logger
def run(pyi_args: Iterable[str] | None = ..., pyi_config: _PyIConfig | None = ...) -> None: ...

View File

@@ -1,5 +1,6 @@
# https://pyinstaller.org/en/stable/hooks.html
import logging
from _typeshed import StrOrBytesPath, StrPath
from collections.abc import Callable, Iterable
from typing import Any
@@ -13,6 +14,7 @@ from PyInstaller.utils.hooks.win32 import get_pywin32_module_file_attribute as g
conda_support = conda
logger: logging.Logger
PY_IGNORE_EXTENSIONS: set[str]
hook_variables: dict[str, str]

View File

@@ -5,6 +5,8 @@ from typing import Any, TypeVar
_R = TypeVar("_R")
logging_logger: Logger
def retry_call(
f: Callable[..., _R],
fargs: Sequence[Any] | None = ...,

View File

@@ -1,8 +1,10 @@
import logging
from _typeshed import Incomplete, SupportsWrite
from collections.abc import Iterable, Iterator
from typing import Any, TypeVar, overload
from typing_extensions import Literal
logger: logging.Logger
DEBUG: bool
CR: str
LF: str