Update pywin32 to mypy 0.990 (#9124)

This commit is contained in:
Samuel T
2022-11-09 22:20:56 -05:00
committed by GitHub
parent a74acc8225
commit 0ac98f6b80
5 changed files with 34 additions and 32 deletions

View File

@@ -2,15 +2,17 @@
_win32typing
win32com(ext)?.mapi._exchdapi
win32._wincerapi
# PyWin tool / debugger
pythonwin.pywin.*
win32com.client.combrowse
win32com.client.tlbrowse
# Utilities to generate python bindings
win32com.client.build
win32com.client.CLSIDToClass
win32com.client.connect
# Necessary for mypy to not throw AssertionError
# "dynamic.CDipatch" is necessary for mypy to not throw AssertionError
win32com.client.dynamic.*
win32com.client.gencache
win32com.client.genpy
@@ -18,6 +20,8 @@ win32com.client.makepy
win32com.client.selecttlb
win32com.client.util
win32com.makegw.*
(win32.lib.)?pywintypes.__import_pywin32_system_module__
# COM object servers scripts
win32com.server.factory
win32com.server.localserver
@@ -26,50 +30,40 @@ win32com.servers.*
# Active X Scripts
win32com(ext)?.axscript.client.framework
win32com(ext)?.axscript.client.pyscript_rexec
# Necessary for mypy to not fail
# "pyscript.pyi" is necessary for mypy to not fail due to missing stub
win32com(ext)?.axscript.client.pyscript.*
win32com(ext)?.axscript.client.scriptdispatch
# Other scripts
isapi.install
win32.scripts.*
win32.lib.netbios
win32.lib.sspi
win32.lib.win32pdhutil
win32.lib.win32rcparser
win32.lib.win32serviceutil
win32.lib.win32traceutil
win32.lib.verstamp
# Demos, tests and debugging
win32.lib.pywin32_testutil
win32.lib.rasutil
win32com.demos.*
win32com.servers.test_pycomtest
win32com.test.*
win32com(ext)?.axdebug.codecontainer
win32com(ext)?.axdebug.dump
win32com(ext)?.axdebug.debugger
win32com(ext)?.axscript.client.debug
win32com(ext)?.axscript.client.pydumper
win32com(ext)?.directsound.test.*
# Deprecated and obsolete
pythoncom.MakeIID
pythoncom.MakeTime
win32.lib.dbi
win32.lib.win32pdhquery.Query.addperfcounter
(win32.lib.)?win32pdhquery.Query.addperfcounter
# Deprecated and makes a buffer of random junk. Use something like `b"\x00" * bufferSize` instead
win32.win32gui.PyMakeBuffer
# Also a script
win32.lib.regcheck
(win32.)?win(32|xp)gui.PyMakeBuffer
# failed to import, ImportError: DLL load failed while importing axdebug: The specified module could not be found.
# https://github.com/python/mypy/issues/13822
win32com.axdebug.axdebug
win32com(ext)?.axdebug.adb
win32com(ext)?.axdebug.codecontainer
# failed to import, SystemError: CoInternetCreateSecurityManager() method: bad call flags
win32com(ext)?.internet.internet
# failed to import, ModuleNotFoundError: No module named '...'
# failed to import, ModuleNotFoundError: No module named 'gateways'
win32com(ext)?.axdebug.contexts
win32com(ext)?.axdebug.debugger
# failed to import, ModuleNotFoundError: No module named 'axdebug'
win32com(ext)?.axdebug.adb
win32com(ext)?.axdebug.documents
win32com(ext)?.axdebug.expressions
# failed to import, ModuleNotFoundError: No module named 'expressions'
win32com(ext)?.axdebug.stackframe
win32com(ext)?.axscript.client.debug
# failed to import, SystemError: CoInternetCreateSecurityManager() method: bad call flags
win32com(ext)?.internet.internet

View File

@@ -1,9 +1,6 @@
version = "304.*"
[tool.stubtest]
ignore_missing_stub = false
# The library only works on Windows; we currently only run stubtest on Ubuntu for third-party stubs in CI.
# See #8660
skip = true
# This crashes stubtest. It should be fixed in next mypy update
# (keeping it since we currently skip the stub anyway)
# https://github.com/python/mypy/issues/13822
ignore_missing_stub = false

View File

@@ -9,6 +9,8 @@ from win32.lib.pywintypes import com_error as com_error
error: TypeAlias = com_error # noqa: Y042
class internal_error(Exception): ...
def CoCreateFreeThreadedMarshaler(unk: _win32typing.PyIUnknown) -> _win32typing.PyIUnknown: ...
def CoCreateInstanceEx(
clsid: _win32typing.PyIID,
@@ -133,6 +135,8 @@ def CoGetCancelObject(riid: _win32typing.PyIID, ThreadID: int = ...) -> _win32ty
def CoSetCancelObject(Unk: _win32typing.PyIUnknown) -> None: ...
def CoEnableCallCancellation() -> None: ...
def CoDisableCallCancellation() -> None: ...
def CreateURLMonikerEx(*args, **kwargs): ... # incomplete
def new(__iid: _win32typing.PyIID | str): ...
ACTIVEOBJECT_STRONG: int
ACTIVEOBJECT_WEAK: int
@@ -154,8 +158,6 @@ COINIT_SPEED_OVER_MEMORY: int
COWAIT_ALERTABLE: int
COWAIT_WAITALL: int
def CreateURLMonikerEx(*args, **kwargs): ... # incomplete
DATADIR_GET: int
DATADIR_SET: int
DESCKIND_FUNCDESC: int

View File

@@ -1,6 +1,7 @@
# Can't generate with stubgen because:
# "KeyError: 'pywintypes'"
from _typeshed import Incomplete
from datetime import datetime
from typing_extensions import Literal
import _win32typing
@@ -8,6 +9,9 @@ import _win32typing
class error(Exception): ...
class com_error(Exception): ...
class TimeType(datetime):
Format = datetime.strftime
def DosDateTimeToTime() -> _win32typing.PyTime: ...
def Unicode() -> str: ...
def UnicodeFromRaw(_str: str) -> str: ...
@@ -23,8 +27,8 @@ def SECURITY_DESCRIPTOR() -> _win32typing.PySECURITY_DESCRIPTOR: ...
def HANDLE() -> int: ...
def HKEY() -> _win32typing.PyHKEY: ...
def WAVEFORMATEX() -> _win32typing.PyWAVEFORMATEX: ...
def TimeStamp(*args, **kwargs): ... # incomplete
FALSE: Literal[False]
TRUE: Literal[True]
def TimeStamp(*args, **kwargs): ... # incomplete
WAVE_FORMAT_PCM: int

View File

@@ -1 +1,6 @@
from win32.win32gui import *
def GetConsoleWindow() -> int: ...
# Actually returns a list of int|tuple, but lists don't support positional types
def GetWindowRgnBox(__hWnd: int) -> tuple[int, tuple[int, int, int, int]]: ...