Skip to content

Commit 16933b8

Browse files
authored
Bump mypy (and a few other test dependencies) (python#11196)
1 parent c1137ee commit 16933b8

File tree

12 files changed

+17
-18
lines changed

12 files changed

+17
-18
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- uses: actions/checkout@v4
5353
- uses: chartboost/ruff-action@v1
5454
with:
55-
version: "0.1.7" # must match .pre-commit-config.yaml and requirements-test.txt
55+
version: "0.1.9" # must match .pre-commit-config.yaml and requirements-test.txt
5656

5757
flake8:
5858
name: Lint with Flake8

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ repos:
1010
- id: mixed-line-ending
1111
- id: check-case-conflict
1212
- repo: https://github.com/psf/black-pre-commit-mirror
13-
rev: 23.11.0 # must match requirements-tests.txt
13+
rev: 23.12.0 # must match requirements-tests.txt
1414
hooks:
1515
- id: black
1616
language_version: python3.10
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.1.7 # must match requirements-tests.txt and tests.yml
18+
rev: v0.1.9 # must match requirements-tests.txt and tests.yml
1919
hooks:
2020
- id: ruff
2121
args: [--exit-non-zero-on-fix, --fix-only]

requirements-tests.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Type checkers and other linters that we test our stubs against. These should always
22
# be pinned to a specific version to make failure reproducible. See also the
33
# "tool.typeshed" section in pyproject.toml for additional type checkers.
4-
black==23.11.0 # must match .pre-commit-config.yaml
4+
black==23.12.0 # must match .pre-commit-config.yaml
55
flake8==6.1.0 # must match .pre-commit-config.yaml
66
flake8-bugbear==23.12.2 # must match .pre-commit-config.yaml
77
flake8-noqa==1.3.2 # must match .pre-commit-config.yaml
88
flake8-pyi==23.11.0 # must match .pre-commit-config.yaml
9-
mypy==1.7.1
9+
mypy==1.8.0
1010
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
1111
pytype==2023.12.8; platform_system != "Windows" and python_version < "3.12"
12-
ruff==0.1.7 # must match .pre-commit-config.yaml and tests.yml
12+
ruff==0.1.9 # must match .pre-commit-config.yaml and tests.yml
1313

1414
# Libraries used by our various scripts.
1515
aiohttp==3.9.1

stdlib/asyncore.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ if sys.platform != "win32":
8383
def write(self, data: bytes, flags: int = ...) -> int: ...
8484
def close(self) -> None: ...
8585
def fileno(self) -> int: ...
86+
def __del__(self) -> None: ...
8687

8788
class file_dispatcher(dispatcher):
8889
def __init__(self, fd: FileDescriptorLike, map: _MapType | None = None) -> None: ...

stubs/pyasn1/@tests/stubtest_allowlist.txt

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# type_check_only
2-
pyasn1.type.base.NoValue.plug
3-
41
# typeshed typing differences with runtime collections.OrderedDict and builtins.dict
52
pyasn1.codec.native.encoder.SequenceEncoder.protoDict
63
pyasn1.codec.native.encoder.SetEncoder.protoDict
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# These __init__ methods have *args, **kwargs arguments on some platforms, but not others
22
pynput.keyboard.Controller.__init__
33

4+
# To reduce duplication, our stubs simplify things:
5+
# the runtime has several Controller classes,
6+
# some of which have __del__ methods on linux, and some of which don't.
7+
pynput.mouse.Controller.__del__
8+
pynput.keyboard.Controller.__del__
9+
410
# Platform specific implementation detail:
511
pynput.keyboard.Controller.keyboard_mapping

stubs/python-xlib/@tests/stubtest_allowlist.txt

-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ Xlib.protocol.rq.*.structcode
1717
# Should only ever be str once instantiated
1818
Xlib.protocol.rq.*.name
1919

20-
# Structs generate their attributes (@type_check_only)
21-
Xlib.protocol.rq.Struct.__getattr__
22-
2320
# Iteration variable that bleeds into the global scope
2421
Xlib.protocol.rq.c
2522
Xlib.protocol.rq.size

stubs/python-xlib/Xlib/protocol/rq.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ class GetAttrData:
365365
# GetAttrData classes get their attributes dynamically
366366
# TODO: Complete all classes inheriting from GetAttrData
367367
def __getattr__(self, attr: str) -> Any: ...
368-
@type_check_only
369368
def __setattr__(self, __name: str, __value: Any) -> None: ...
370369

371370
class DictWrapper(GetAttrData):

tests/stubtest_allowlists/py310.txt

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ types.GenericAlias.__mro_entries__
2424
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
2525
typing._SpecialForm.__mro_entries__
2626
weakref.ProxyType.__reversed__ # Doesn't really exist
27+
builtins.ellipsis # type is not exposed anywhere
2728

2829
# Modules that exist at runtime, but shouldn't be added to typeshed
2930
ctypes.test

tests/stubtest_allowlists/py311.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined
1616
importlib.abc.Finder.find_module
1717
tkinter._VersionInfoType.__doc__
1818
typing.NewType.__mro_entries__
19+
builtins.ellipsis # type is not exposed anywhere
1920

2021
# Modules that exist at runtime, but shouldn't be added to typeshed
2122
ctypes.test

tests/stubtest_allowlists/py312.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ enum.Enum.__init__
1414
importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
1515
tkinter._VersionInfoType.__doc__
1616
typing.NewType.__mro_entries__
17+
builtins.ellipsis # type is not exposed anywhere
1718

1819
# ==========
1920
# Related to positional-only arguments

tests/stubtest_allowlists/py3_common.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ asyncio.base_events.BaseEventLoop.subprocess_exec # BaseEventLoop adds several p
2424
asyncio.Future.__init__ # Usually initialized from c object
2525
asyncio.futures.Future.__init__ # Usually initialized from c object
2626
builtins.dict.get
27-
builtins.ellipsis # type is not exposed anywhere
28-
builtins.function
2927
collections.ChainMap.fromkeys # Runtime has *args which can really only be one argument
3028
collections.UserList.sort # Runtime has *args but will error if any are supplied
3129
configparser.SectionProxy.__getattr__ # SectionProxy can have arbitrary attributes when custom converters are used
@@ -479,8 +477,7 @@ typing_extensions\.TypeVar.*
479477
typing_extensions\.ParamSpec.*
480478
typing(_extensions)?\.Generic
481479
typing\.Protocol
482-
(typing\._TypedDict\..+)?
483-
typing_extensions\._TypedDict\..*
480+
typing(_extensions)?\._TypedDict
484481

485482
# Special primitives
486483
typing_extensions\.Annotated
@@ -513,7 +510,6 @@ typing(_extensions)?\.Coroutine
513510
typing(_extensions)?\.Collection
514511
typing(_extensions)?\.Container
515512
typing\.ByteString
516-
typing(_extensions)?\.AwaitableGenerator
517513
typing(_extensions)?\.Awaitable
518514
typing(_extensions)?\.AbstractSet
519515

0 commit comments

Comments
 (0)