Bump mypy to 1.6.1 (#10862)

This commit is contained in:
Alex Waygood
2023-10-18 07:18:05 +01:00
committed by GitHub
parent 1ecaab1641
commit 2f8d01e9ec
11 changed files with 145 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ flake8-bugbear==23.9.16 # must match .pre-commit-config.yaml
flake8-noqa==1.3.2 # must match .pre-commit-config.yaml
flake8-pyi==23.10.0 # must match .pre-commit-config.yaml
isort==5.12.0 # must match .pre-commit-config.yaml
mypy==1.5.1
mypy==1.6.1
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
pytype==2023.10.17; platform_system != "Windows" and python_version < "3.12"
ruff==0.1.0 # must match .pre-commit-config.yaml

View File

@@ -57,7 +57,7 @@ class Task(Generic[_P, _R_co]):
def get_arguments(self, ignore_unknown_help: bool | None = None) -> list[Argument]: ...
@overload
def task(
def task( # type: ignore[misc]
*args: Task[..., Any] | Call,
name: str | None = ...,
aliases: tuple[str, ...] = ...,

View File

@@ -1,4 +1,5 @@
_posixsubprocess.cloexec_pipe
curses.has_key
(os|posix).sched_param # system dependent. Unclear if macos has it.
select.KQ_FILTER_NETDEV # system dependent
select.kqueue.__init__ # default C signature is wrong

View File

@@ -1,5 +1,6 @@
_socket.*
_posixsubprocess.cloexec_pipe
curses.has_key
os.plock
selectors.KqueueSelector
socket.[A-Z0-9_]+

View File

@@ -24,6 +24,21 @@ types.GenericAlias.__call__ # Would be complicated to fix properly, Any could s
typing._SpecialForm.__mro_entries__
weakref.ProxyType.__reversed__ # Doesn't really exist
# Modules that exist at runtime, but are missing from typeshed
importlib.readers
# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
ctypes\.test\..+
lib2to3.tests
lib2to3\.tests\..+
sqlite3.test
sqlite3\.test\..+
tkinter.test
tkinter\.test\..+
unittest.test
unittest\.test\..+
# Exist at runtime for internal reasons, no need to put them in the stub
typing_extensions\.TypeAliasType\.__call__
typing_extensions\.TypeAliasType\.__init_subclass__

View File

@@ -17,6 +17,22 @@ tkinter._VersionInfoType.__doc__
typing.NewType.__call__
typing.NewType.__mro_entries__
# Modules that exist at runtime, but are missing from typeshed
importlib.readers
importlib.resources.readers
importlib.resources.simple
importlib.simple
# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
ctypes\.test\..+
lib2to3.tests
lib2to3\.tests\..+
tkinter.test
tkinter\.test\..+
unittest.test
unittest\.test\..+
# ==========
# Related to positional-only arguments
# ==========

View File

@@ -1,3 +1,10 @@
# Modules that exist at runtime, but are missing from typeshed
zipfile._path.glob
importlib.readers
importlib.resources.readers
importlib.resources.simple
importlib.simple
# Errors that also existed on Python 3.11
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__

View File

@@ -1,4 +1,13 @@
_dummy_threading
_dummy_threading.Condition.acquire
_dummy_threading.Condition.release
_dummy_threading.Event.isSet
_dummy_threading.ExceptHookArgs
_dummy_threading.Lock
_dummy_threading.RLock
_dummy_threading.Thread.native_id
_dummy_threading._DummyThread.__init__
_dummy_threading._RLock.__enter__
_dummy_threading.local.__new__
asyncio.locks._ContextManagerMixin.__enter__ # Always raises; deliberately omitted from the stub
asyncio.locks._ContextManagerMixin.__exit__ # Always raises; deliberately omitted from the stub
asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself
@@ -41,6 +50,7 @@ typing.NamedTuple._replace
typing._SpecialForm.__new__
xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495
xml.etree.cElementTree.TreeBuilder.start # bpo-39495
xxsubtype # module missing from the stubs
# Exist at runtime for internal reasons, no need to put them in the stub
typing_extensions\.TypeAliasType\.__call__
@@ -158,3 +168,16 @@ pkgutil.ImpImporter\..*
pkgutil.ImpLoader\..*
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
ctypes\.test\..+
lib2to3.tests
lib2to3\.tests\..+
sqlite3.test
sqlite3\.test\..+
test
tkinter.test
tkinter\.test\..+
unittest.test
unittest\.test\..+

View File

@@ -37,6 +37,7 @@ tkinter.Tk.split
types.GenericAlias.__getattr__
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
weakref.ProxyType.__reversed__ # Doesn't really exist
xxsubtype # module missing from the stubs
# Exist at runtime for internal reasons, no need to put them in the stub
typing_extensions\.TypeAliasType\.__call__
@@ -55,6 +56,19 @@ collections.Generator.gi_yieldfrom
collections.Mapping.get # Adding None to the Union messed up mypy
collections.Sequence.index # Supporting None in end is not mandatory
# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
ctypes\.test\..+
lib2to3.tests
lib2to3\.tests\..+
sqlite3.test
sqlite3\.test\..+
test
tkinter.test
tkinter\.test\..+
unittest.test
unittest\.test\..+
# Exists at runtime, but missing from stubs
_collections_abc.AsyncIterable.__class_getitem__
_collections_abc.Awaitable.__class_getitem__

View File

@@ -134,8 +134,69 @@ xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signatur
xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signature
xml.parsers.expat.expat_CAPI
# Modules that exist at runtime, but shouldn't be added to typeshed
idlelib
# ==========
# Exists at runtime, but missing from stubs
# Modules that exist at runtime, but are missing from stubs
# ==========
ctypes.macholib
ctypes.macholib.dyld
ctypes.macholib.dylib
ctypes.macholib.framework
encodings.aliases
encodings.ascii
encodings.base64_codec
encodings.big5
encodings.big5hkscs
encodings.bz2_codec
encodings.charmap
encodings\.cp\d+
encodings\.euc_.+
encodings.gb18030
encodings.gb2312
encodings.gbk
encodings.hex_codec
encodings.hp_roman8
encodings.hz
encodings.idna
encodings\.iso2022_.*
encodings\.iso8859_\d+
encodings.johab
encodings\.koi8_\w
encodings.kz1048
encodings.latin_1
encodings\.mac_.+
encodings.palmos
encodings.ptcp154
encodings.punycode
encodings.quopri_codec
encodings.raw_unicode_escape
encodings.rot_13
encodings\.shift_jis.*
encodings.tis_620
encodings.undefined
encodings.unicode_escape
encodings.utf_16
encodings.utf_16_be
encodings.utf_16_le
encodings.utf_32
encodings.utf_32_be
encodings.utf_32_le
encodings.utf_7
encodings.uu_codec
encodings.zlib_codec
json.scanner
lib2to3.btm_utils
lib2to3.fixer_util
lib2to3.patcomp
sqlite3.dump
turtledemo
turtledemo\..+
xml.sax.expatreader
# ==========
# Module members that exist at runtime, but are missing from stubs
# ==========
_json.encode_basestring
_socket.CAPI

View File

@@ -4,6 +4,9 @@ ctypes.GetLastError # Is actually a pointer
multiprocessing.reduction.AbstractReducer.DupHandle
# Exists at runtime, but missing from stubs
encodings.mbcs
encodings.oem
nt
_winapi.CreateFileMapping
_winapi.MapViewOfFile
_winapi.OpenFileMapping