Skip to content

Commit dba47e0

Browse files
authored
Add reportMissingParameterType to pyrightconfig.stricter.json (#8770)
1 parent d7160ca commit dba47e0

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

pyrightconfig.stricter.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
"stubs/invoke",
5252
"stubs/jmespath",
5353
"stubs/jsonschema",
54-
"stubs/keyboard",
5554
"stubs/ldap3",
5655
"stubs/Markdown",
5756
"stubs/mock",
@@ -99,6 +98,7 @@
9998
"strictSetInference": true,
10099
"reportFunctionMemberAccess": "error",
101100
"reportMissingModuleSource": "none",
101+
"reportMissingParameterType": "error",
102102
"reportMissingTypeStubs": "error",
103103
"reportUnusedImport": "error",
104104
"reportUnusedClass": "error",

stubs/keyboard/keyboard/mouse.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class _MouseListener(_GenericListener):
3535
) -> Literal[True]: ...
3636
def listen(self) -> None: ...
3737

38-
def is_pressed(button: _MouseButton = ...): ...
38+
def is_pressed(button: _MouseButton = ...) -> bool: ...
3939
def press(button: _MouseButton = ...) -> None: ...
4040
def release(button: _MouseButton = ...) -> None: ...
4141
def click(button: _MouseButton = ...) -> None: ...
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Referenced in: https://pyinstaller.org/en/stable/hooks.html?highlight=get_hook_config#PyInstaller.utils.hooks.get_hook_config
22
# Not to be imported during runtime, but is the type reference for hooks and analysis configuration
33

4-
from _typeshed import StrPath
4+
from _typeshed import Incomplete, StrPath
55
from collections.abc import Iterable
66
from typing import Any
77

@@ -13,17 +13,17 @@ class Analysis(Target):
1313
def __init__(
1414
self,
1515
scripts: Iterable[StrPath],
16-
pathex=...,
17-
binaries=...,
18-
datas=...,
19-
hiddenimports=...,
20-
hookspath=...,
16+
pathex: Incomplete | None = ...,
17+
binaries: Incomplete | None = ...,
18+
datas: Incomplete | None = ...,
19+
hiddenimports: Incomplete | None = ...,
20+
hookspath: Incomplete | None = ...,
2121
hooksconfig: dict[str, dict[str, Any]] | None = ...,
22-
excludes=...,
23-
runtime_hooks=...,
24-
cipher=...,
22+
excludes: Incomplete | None = ...,
23+
runtime_hooks: Incomplete | None = ...,
24+
cipher: Incomplete | None = ...,
2525
win_no_prefer_redirects: bool = ...,
2626
win_private_assemblies: bool = ...,
2727
noarchive: bool = ...,
28-
module_collection_mode=...,
28+
module_collection_mode: Incomplete | None = ...,
2929
) -> None: ...

stubs/pyinstaller/PyInstaller/depend/analysis.pyi

+16-7
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@
22

33
# The documentation explicitely mentions that "Normally you do not need to know about the module-graph."
44
# However, some PyiModuleGraph typed class attributes are still documented as existing in imphookapi.
5-
from _typeshed import Incomplete
5+
from _typeshed import Incomplete, StrPath, SupportsKeysAndGetItem
6+
from collections.abc import Iterable
7+
from typing_extensions import TypeAlias
8+
9+
from PyInstaller.lib.modulegraph.modulegraph import Alias, Node
10+
11+
_LazyNode: TypeAlias = Iterable[Node] | Iterable[str] | Alias | None
12+
# from altgraph.Graph import Graph
13+
_Graph: TypeAlias = Incomplete
614

715
class PyiModuleGraph: # incomplete
816
def __init__(
917
self,
1018
pyi_homepath: str,
11-
user_hook_dirs=...,
12-
excludes=...,
13-
path: Incomplete | None = ...,
14-
replace_paths=...,
15-
implies=...,
16-
graph: Incomplete | None = ...,
19+
user_hook_dirs: Iterable[StrPath] = ...,
20+
excludes: Iterable[str] = ...,
21+
*,
22+
path: Iterable[str] | None = ...,
23+
replace_paths: Iterable[tuple[StrPath, StrPath]] = ...,
24+
implies: SupportsKeysAndGetItem[str, _LazyNode] | Iterable[tuple[str, _LazyNode]] = ...,
25+
graph: _Graph | None = ...,
1726
debug: int = ...,
1827
) -> None: ...

stubs/pyinstaller/PyInstaller/lib/modulegraph/modulegraph.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class Node:
3030
def __ge__(self, other: _SupportsGraphident) -> bool: ...
3131
def infoTuple(self) -> tuple[str]: ...
3232

33+
class Alias(str): ...
34+
3335
class BaseModule(Node):
3436
filename: str
3537
packagepath: str

0 commit comments

Comments
 (0)