diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index f74d6db31..5db60697d 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -51,7 +51,6 @@ "stubs/invoke", "stubs/jmespath", "stubs/jsonschema", - "stubs/keyboard", "stubs/ldap3", "stubs/Markdown", "stubs/mock", @@ -99,6 +98,7 @@ "strictSetInference": true, "reportFunctionMemberAccess": "error", "reportMissingModuleSource": "none", + "reportMissingParameterType": "error", "reportMissingTypeStubs": "error", "reportUnusedImport": "error", "reportUnusedClass": "error", diff --git a/stubs/keyboard/keyboard/mouse.pyi b/stubs/keyboard/keyboard/mouse.pyi index 6285b0b05..48a10d234 100644 --- a/stubs/keyboard/keyboard/mouse.pyi +++ b/stubs/keyboard/keyboard/mouse.pyi @@ -35,7 +35,7 @@ class _MouseListener(_GenericListener): ) -> Literal[True]: ... def listen(self) -> None: ... -def is_pressed(button: _MouseButton = ...): ... +def is_pressed(button: _MouseButton = ...) -> bool: ... def press(button: _MouseButton = ...) -> None: ... def release(button: _MouseButton = ...) -> None: ... def click(button: _MouseButton = ...) -> None: ... diff --git a/stubs/pyinstaller/PyInstaller/building/build_main.pyi b/stubs/pyinstaller/PyInstaller/building/build_main.pyi index d53ffb411..81fb89f25 100644 --- a/stubs/pyinstaller/PyInstaller/building/build_main.pyi +++ b/stubs/pyinstaller/PyInstaller/building/build_main.pyi @@ -1,7 +1,7 @@ # Referenced in: https://pyinstaller.org/en/stable/hooks.html?highlight=get_hook_config#PyInstaller.utils.hooks.get_hook_config # Not to be imported during runtime, but is the type reference for hooks and analysis configuration -from _typeshed import StrPath +from _typeshed import Incomplete, StrPath from collections.abc import Iterable from typing import Any @@ -13,17 +13,17 @@ class Analysis(Target): def __init__( self, scripts: Iterable[StrPath], - pathex=..., - binaries=..., - datas=..., - hiddenimports=..., - hookspath=..., + pathex: Incomplete | None = ..., + binaries: Incomplete | None = ..., + datas: Incomplete | None = ..., + hiddenimports: Incomplete | None = ..., + hookspath: Incomplete | None = ..., hooksconfig: dict[str, dict[str, Any]] | None = ..., - excludes=..., - runtime_hooks=..., - cipher=..., + excludes: Incomplete | None = ..., + runtime_hooks: Incomplete | None = ..., + cipher: Incomplete | None = ..., win_no_prefer_redirects: bool = ..., win_private_assemblies: bool = ..., noarchive: bool = ..., - module_collection_mode=..., + module_collection_mode: Incomplete | None = ..., ) -> None: ... diff --git a/stubs/pyinstaller/PyInstaller/depend/analysis.pyi b/stubs/pyinstaller/PyInstaller/depend/analysis.pyi index 2ae95b655..4e1682dd3 100644 --- a/stubs/pyinstaller/PyInstaller/depend/analysis.pyi +++ b/stubs/pyinstaller/PyInstaller/depend/analysis.pyi @@ -2,17 +2,26 @@ # The documentation explicitely mentions that "Normally you do not need to know about the module-graph." # However, some PyiModuleGraph typed class attributes are still documented as existing in imphookapi. -from _typeshed import Incomplete +from _typeshed import Incomplete, StrPath, SupportsKeysAndGetItem +from collections.abc import Iterable +from typing_extensions import TypeAlias + +from PyInstaller.lib.modulegraph.modulegraph import Alias, Node + +_LazyNode: TypeAlias = Iterable[Node] | Iterable[str] | Alias | None +# from altgraph.Graph import Graph +_Graph: TypeAlias = Incomplete class PyiModuleGraph: # incomplete def __init__( self, pyi_homepath: str, - user_hook_dirs=..., - excludes=..., - path: Incomplete | None = ..., - replace_paths=..., - implies=..., - graph: Incomplete | None = ..., + user_hook_dirs: Iterable[StrPath] = ..., + excludes: Iterable[str] = ..., + *, + path: Iterable[str] | None = ..., + replace_paths: Iterable[tuple[StrPath, StrPath]] = ..., + implies: SupportsKeysAndGetItem[str, _LazyNode] | Iterable[tuple[str, _LazyNode]] = ..., + graph: _Graph | None = ..., debug: int = ..., ) -> None: ... diff --git a/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi b/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi index 0bbb6ee13..ef9cfc5c9 100644 --- a/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi +++ b/stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi @@ -30,6 +30,8 @@ class Node: def __ge__(self, other: _SupportsGraphident) -> bool: ... def infoTuple(self) -> tuple[str]: ... +class Alias(str): ... + class BaseModule(Node): filename: str packagepath: str