Skip to content

Commit 65e8713

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents a64f366 + 5029b19 commit 65e8713

File tree

12 files changed

+29
-29
lines changed

12 files changed

+29
-29
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ typing_extensions>=4.4.0
99

1010
# Windows
1111
pywin32>=302; sys_platform == 'win32'
12-
types-pywin32>=304.0.0.4
12+
types-pywin32>=305.0.0.3
1313

1414
# Linux
1515
xlib>=0.21; sys_platform == 'linux'

pyrightconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"reportImplicitStringConcatenation": "error",
1111
"reportCallInDefaultInitializer": "error",
1212
"reportPropertyTypeMismatch": "error",
13+
"reportUnnecessaryTypeIgnoreComment": "error",
1314
// type: ignore comments are meant for mypy
14-
"reportUnnecessaryTypeIgnoreComment": "information",
15+
"enableTypeIgnoreComments": false,
1516
// False positives with TYPE_CHECKING and defered imports
1617
"reportImportCycles": "information",
1718
// As a library, we're allowed to use our own privates

src/pywinctl/__init__.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from collections.abc import Callable
1212
from typing import Any, NamedTuple, cast
1313

14-
import pyrect # type: ignore[import] # TODO: Create type stubs or add to base library
14+
import pyrect # type: ignore[import] # pyright: ignore[reportMissingTypeStubs] # TODO: Create type stubs or add to base library
1515

1616

1717
__all__ = [
@@ -79,17 +79,17 @@ class Re:
7979
# Does not play well with static typing and current implementation of TypedDict
8080
_cond_dic: dict[int, Callable[[str | re.Pattern[str], str, float], bool]] = {
8181
IS: lambda s1, s2, fl: s1 == s2,
82-
CONTAINS: lambda s1, s2, fl: s1 in s2, # type: ignore
83-
STARTSWITH: lambda s1, s2, fl: s2.startswith(s1), # type: ignore
84-
ENDSWITH: lambda s1, s2, fl: s2.endswith(s1), # type: ignore
82+
CONTAINS: lambda s1, s2, fl: s1 in s2, # type: ignore # pyright: ignore
83+
STARTSWITH: lambda s1, s2, fl: s2.startswith(s1), # type: ignore # pyright: ignore
84+
ENDSWITH: lambda s1, s2, fl: s2.endswith(s1), # type: ignore # pyright: ignore
8585
NOTIS: lambda s1, s2, fl: s1 != s2,
86-
NOTCONTAINS: lambda s1, s2, fl: s1 not in s2, # type: ignore
87-
NOTSTARTSWITH: lambda s1, s2, fl: not s2.startswith(s1), # type: ignore
88-
NOTENDSWITH: lambda s1, s2, fl: not s2.endswith(s1), # type: ignore
89-
MATCH: lambda s1, s2, fl: bool(s1.search(s2)), # type: ignore
90-
NOTMATCH: lambda s1, s2, fl: not (bool(s1.search(s2))), # type: ignore
91-
EDITDISTANCE: lambda s1, s2, fl: _levenshtein(s1, s2) >= fl, # type: ignore
92-
DIFFRATIO: lambda s1, s2, fl: difflib.SequenceMatcher(None, s1, s2).ratio() * 100 >= fl # type: ignore
86+
NOTCONTAINS: lambda s1, s2, fl: s1 not in s2, # type: ignore # pyright: ignore
87+
NOTSTARTSWITH: lambda s1, s2, fl: not s2.startswith(s1), # type: ignore # pyright: ignore
88+
NOTENDSWITH: lambda s1, s2, fl: not s2.endswith(s1), # type: ignore # pyright: ignore
89+
MATCH: lambda s1, s2, fl: bool(s1.search(s2)), # type: ignore # pyright: ignore
90+
NOTMATCH: lambda s1, s2, fl: not (bool(s1.search(s2))), # type: ignore # pyright: ignore
91+
EDITDISTANCE: lambda s1, s2, fl: _levenshtein(s1, s2) >= fl, # type: ignore # pyright: ignore
92+
DIFFRATIO: lambda s1, s2, fl: difflib.SequenceMatcher(None, s1, s2).ratio() * 100 >= fl # type: ignore # pyright: ignore
9393
}
9494

9595

src/pywinctl/_pywinctl_linux.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def __remove_bad_windows(windows: Iterable[Window | None]):
116116
"""
117117
for window in windows:
118118
try:
119-
yield LinuxWindow(window) # type: ignore[arg-type,reportGeneralTypeIssues] # We expect an error here
119+
yield LinuxWindow(window) # type: ignore[arg-type] # pyright: ignore[reportGeneralTypeIssues] # We expect an error here
120120
except Xlib.error.XResourceError:
121121
pass
122122

@@ -808,7 +808,7 @@ def acceptInput(self, setTo: bool) -> None:
808808
data = (32, [Xlib.Xutil.VisualScreenMask, 0, 0, 0, 0]) # it seems to work with any atom (like Xlib.Xutil.IconicState)
809809
ev = Xlib.protocol.event.ClientMessage(window=self._hWnd.id, client_type=prop, data=data)
810810
# TODO: Xlib stubs need to be updated to accept xobjects in structs/Requests, not just ids
811-
DISP.send_event(destination=ROOT, event=ev, event_mask=mask) # type: ignore[call-overload] # pyright: ignore[reportGeneralTypeIssues]
811+
DISP.send_event(destination=ROOT, event=ev, event_mask=mask) # type: ignore[call-overload]
812812

813813
def getAppName(self) -> str:
814814
"""

src/pywinctl/_pywinctl_macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ def isActive(self) -> bool:
12831283
return active is not None and active._app == self._app and active.title == self.title
12841284

12851285
@property
1286-
def title(self) -> str | None: # type: ignore[override]
1286+
def title(self) -> str | None: # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
12871287
"""
12881288
Get the current window title, as string.
12891289
IMPORTANT: window title may change. In that case, it will return None.

src/pywinctl/_pywinctl_win.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,12 +709,11 @@ def acceptInput(self, setTo: bool) -> None:
709709
:param setTo: True/False to toggle window transparent to input and focus
710710
:return: None
711711
"""
712-
# These ignores will all be fixed by https://github.com/python/typeshed/pull/9308
713-
exStyle = win32api.GetWindowLong(self._hWnd, win32con.GWL_EXSTYLE) # pyright: ignore[reportUnknownMemberType, reportUnknownVariableType]
712+
exStyle = win32api.GetWindowLong(self._hWnd, win32con.GWL_EXSTYLE)
714713
if setTo:
715-
win32api.SetWindowLong(self._hWnd, win32con.GWL_EXSTYLE, exStyle & ~win32con.WS_EX_TRANSPARENT) # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType]
714+
win32api.SetWindowLong(self._hWnd, win32con.GWL_EXSTYLE, exStyle & ~win32con.WS_EX_TRANSPARENT)
716715
else:
717-
win32api.SetWindowLong(self._hWnd, win32con.GWL_EXSTYLE, exStyle | win32con.WS_EX_TRANSPARENT) # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType]
716+
win32api.SetWindowLong(self._hWnd, win32con.GWL_EXSTYLE, exStyle | win32con.WS_EX_TRANSPARENT)
718717

719718
def getAppName(self) -> str:
720719
"""

typings/Quartz/ImageKit/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# mypy: disable-error-code=type-arg
33
from typing import Any
44

5-
import objc._lazyimport # type: ignore
5+
import objc._lazyimport # type: ignore # pyright: ignore
66

77
IKCameraDeviceViewDisplayMode: Any
88
IKCameraDeviceViewTransferMode: Any

typings/Quartz/PDFKit/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# mypy: disable-error-code=type-arg
33
from typing import Any
44

5-
import objc._lazyimport # type: ignore
5+
import objc._lazyimport # type: ignore # pyright: ignore
66

77
PDFAccessPermissions: Any
88
PDFActionNamedName: Any

typings/Quartz/QuartzCore/__init__.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# mypy: disable-error-code=type-arg
33
from typing import Any, ClassVar
44

5-
import objc # type: ignore
6-
import objc._lazyimport # type: ignore
5+
import objc # type: ignore # pyright: ignore
6+
import objc._lazyimport # type: ignore # pyright: ignore
77

88
CAAnimationCalculationMode: Any
99
CAAnimationRotationMode: Any
@@ -49,7 +49,7 @@ r: Any
4949
protocols: Any
5050
expressions: Any
5151

52-
class CAFrameRateRange(objc._structwrapper): # type: ignore
52+
class CAFrameRateRange(objc._structwrapper): # type: ignore # pyright: ignore
5353
_fields: ClassVar[tuple] = ...
5454
__match_args__: ClassVar[tuple] = ...
5555
__typestr__: ClassVar[bytes] = ...
@@ -68,7 +68,7 @@ class CAFrameRateRange(objc._structwrapper): # type: ignore
6868
def __setattr__(self, name, value) -> Any: ...
6969
def __setitem__(self, index, object) -> Any: ...
7070

71-
class CATransform3D(objc._structwrapper): # type: ignore
71+
class CATransform3D(objc._structwrapper): # type: ignore # pyright: ignore
7272
_fields: ClassVar[tuple] = ...
7373
__match_args__: ClassVar[tuple] = ...
7474
__typestr__: ClassVar[bytes] = ...

typings/Quartz/QuartzFilters/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pyright: reportUnknownParameterType=false, reportMissingParameterType=false, reportMissingTypeArgument=false
22
from typing import Any
33

4-
import Foundation as Foundation # type: ignore
4+
import Foundation as Foundation # type: ignore # pyright: ignore
55

66

77
def sel32or64(a, b): ...

0 commit comments

Comments
 (0)