Skip to content

Bump mypy (and a few other test dependencies) #11196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
version: "0.1.7" # must match .pre-commit-config.yaml and requirements-test.txt
version: "0.1.9" # must match .pre-commit-config.yaml and requirements-test.txt

flake8:
name: Lint with Flake8
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ repos:
- id: mixed-line-ending
- id: check-case-conflict
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0 # must match requirements-tests.txt
rev: 23.12.0 # must match requirements-tests.txt
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7 # must match requirements-tests.txt and tests.yml
rev: v0.1.9 # must match requirements-tests.txt and tests.yml
hooks:
- id: ruff
args: [--exit-non-zero-on-fix, --fix-only]
Expand Down
6 changes: 3 additions & 3 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Type checkers and other linters that we test our stubs against. These should always
# be pinned to a specific version to make failure reproducible. See also the
# "tool.typeshed" section in pyproject.toml for additional type checkers.
black==23.11.0 # must match .pre-commit-config.yaml
black==23.12.0 # must match .pre-commit-config.yaml
flake8==6.1.0 # must match .pre-commit-config.yaml
flake8-bugbear==23.12.2 # must match .pre-commit-config.yaml
flake8-noqa==1.3.2 # must match .pre-commit-config.yaml
flake8-pyi==23.11.0 # must match .pre-commit-config.yaml
mypy==1.7.1
mypy==1.8.0
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
pytype==2023.12.8; platform_system != "Windows" and python_version < "3.12"
ruff==0.1.7 # must match .pre-commit-config.yaml and tests.yml
ruff==0.1.9 # must match .pre-commit-config.yaml and tests.yml

# Libraries used by our various scripts.
aiohttp==3.9.1
Expand Down
1 change: 1 addition & 0 deletions stdlib/asyncore.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ if sys.platform != "win32":
def write(self, data: bytes, flags: int = ...) -> int: ...
def close(self) -> None: ...
def fileno(self) -> int: ...
def __del__(self) -> None: ...

class file_dispatcher(dispatcher):
def __init__(self, fd: FileDescriptorLike, map: _MapType | None = None) -> None: ...
Expand Down
3 changes: 0 additions & 3 deletions stubs/pyasn1/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# type_check_only
pyasn1.type.base.NoValue.plug

# typeshed typing differences with runtime collections.OrderedDict and builtins.dict
pyasn1.codec.native.encoder.SequenceEncoder.protoDict
pyasn1.codec.native.encoder.SetEncoder.protoDict
Expand Down
6 changes: 6 additions & 0 deletions stubs/pynput/@tests/stubtest_allowlist_linux.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# These __init__ methods have *args, **kwargs arguments on some platforms, but not others
pynput.keyboard.Controller.__init__

# To reduce duplication, our stubs simplify things:
# the runtime has several Controller classes,
# some of which have __del__ methods on linux, and some of which don't.
pynput.mouse.Controller.__del__
pynput.keyboard.Controller.__del__

# Platform specific implementation detail:
pynput.keyboard.Controller.keyboard_mapping
3 changes: 0 additions & 3 deletions stubs/python-xlib/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ Xlib.protocol.rq.*.structcode
# Should only ever be str once instantiated
Xlib.protocol.rq.*.name

# Structs generate their attributes (@type_check_only)
Xlib.protocol.rq.Struct.__getattr__

# Iteration variable that bleeds into the global scope
Xlib.protocol.rq.c
Xlib.protocol.rq.size
1 change: 0 additions & 1 deletion stubs/python-xlib/Xlib/protocol/rq.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ class GetAttrData:
# GetAttrData classes get their attributes dynamically
# TODO: Complete all classes inheriting from GetAttrData
def __getattr__(self, attr: str) -> Any: ...
@type_check_only
def __setattr__(self, __name: str, __value: Any) -> None: ...

class DictWrapper(GetAttrData):
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ types.GenericAlias.__mro_entries__
types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392
typing._SpecialForm.__mro_entries__
weakref.ProxyType.__reversed__ # Doesn't really exist
builtins.ellipsis # type is not exposed anywhere

# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined
importlib.abc.Finder.find_module
tkinter._VersionInfoType.__doc__
typing.NewType.__mro_entries__
builtins.ellipsis # type is not exposed anywhere

# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum.Enum.__init__
importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
tkinter._VersionInfoType.__doc__
typing.NewType.__mro_entries__
builtins.ellipsis # type is not exposed anywhere

# ==========
# Related to positional-only arguments
Expand Down
6 changes: 1 addition & 5 deletions tests/stubtest_allowlists/py3_common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ asyncio.base_events.BaseEventLoop.subprocess_exec # BaseEventLoop adds several p
asyncio.Future.__init__ # Usually initialized from c object
asyncio.futures.Future.__init__ # Usually initialized from c object
builtins.dict.get
builtins.ellipsis # type is not exposed anywhere
builtins.function
collections.ChainMap.fromkeys # Runtime has *args which can really only be one argument
collections.UserList.sort # Runtime has *args but will error if any are supplied
configparser.SectionProxy.__getattr__ # SectionProxy can have arbitrary attributes when custom converters are used
Expand Down Expand Up @@ -479,8 +477,7 @@ typing_extensions\.TypeVar.*
typing_extensions\.ParamSpec.*
typing(_extensions)?\.Generic
typing\.Protocol
(typing\._TypedDict\..+)?
typing_extensions\._TypedDict\..*
typing(_extensions)?\._TypedDict

# Special primitives
typing_extensions\.Annotated
Expand Down Expand Up @@ -513,7 +510,6 @@ typing(_extensions)?\.Coroutine
typing(_extensions)?\.Collection
typing(_extensions)?\.Container
typing\.ByteString
typing(_extensions)?\.AwaitableGenerator
typing(_extensions)?\.Awaitable
typing(_extensions)?\.AbstractSet

Expand Down