Skip to content

Fix some stubtest complaints before they happen #9585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stdlib/lib2to3/pygram.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from lib2to3.pgen2.grammar import Grammar

class Symbols:
Expand Down Expand Up @@ -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
4 changes: 3 additions & 1 deletion stubs/decorator/decorator.pyi
Original file line number Diff line number Diff line change
@@ -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])
Expand All @@ -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]
Expand Down
3 changes: 3 additions & 0 deletions stubs/dockerfile-parse/dockerfile_parse/parser.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions stubs/playsound/playsound.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import logging
import pathlib

logger: logging.Logger

class PlaysoundException(Exception): ...

def playsound(sound: str | pathlib.Path, block: bool = ...) -> None: ...
3 changes: 3 additions & 0 deletions stubs/pyinstaller/PyInstaller/__main__.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: ...
2 changes: 2 additions & 0 deletions stubs/pyinstaller/PyInstaller/utils/hooks/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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]

Expand Down
2 changes: 2 additions & 0 deletions stubs/retry/retry/api.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ...,
Expand Down
2 changes: 2 additions & 0 deletions stubs/vobject/vobject/base.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down