Skip to content

Commit 4b0623f

Browse files
authored
Update mypy to 1.18.1 (#14699)
1 parent 59c36c8 commit 4b0623f

File tree

31 files changed

+70
-108
lines changed

31 files changed

+70
-108
lines changed

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Type checkers that we test our stubs against. These should always
22
# be pinned to a specific version to make failure reproducible.
3-
mypy==1.17.1
3+
mypy==1.18.1
44
pyright==1.1.405
55

66
# Libraries used by our various scripts.

stubs/Authlib/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# TODO: check these entries
22
authlib.jose.drafts._jwe_enc_cryptodome
3-
authlib.oauth2.OAuth2Client.client_auth_class
4-
authlib.oauth2.OAuth2Client.oauth_error_class
5-
authlib.oauth2.OAuth2Client.token_auth_class
6-
authlib.oauth2.client.OAuth2Client.client_auth_class
7-
authlib.oauth2.client.OAuth2Client.oauth_error_class
8-
authlib.oauth2.client.OAuth2Client.token_auth_class
9-
authlib.oauth2.rfc7521.AssertionClient.oauth_error_class
10-
authlib.oauth2.rfc7521.client.AssertionClient.oauth_error_class
11-
authlib.oauth2.rfc7523.JWTBearerTokenValidator.token_cls
12-
authlib.oauth2.rfc7523.validator.JWTBearerTokenValidator.token_cls
133

144
# Are set to `None` by default, initialized later:
155
authlib.jose.drafts._jwe_algorithms.ECDH1PUAlgorithm.description
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# DictCursorMixin changes method types of inherited classes, but doesn't contain much at runtime
22
pymysql.cursors.DictCursorMixin.__iter__
33
pymysql.cursors.DictCursorMixin.fetch[a-z]*
4+
5+
# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
6+
# See https://github.com/python/typeshed/pull/14699
7+
pymysql.connections.Connection.__init__

stubs/cffi/_cffi_backend.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import types
33
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
44
from collections.abc import Callable, Hashable
55
from typing import Any, ClassVar, Literal, Protocol, SupportsIndex, TypeVar, final, overload, type_check_only
6-
from typing_extensions import TypeAlias
6+
from typing_extensions import Self, TypeAlias
77

88
_T = TypeVar("_T")
99

@@ -92,7 +92,7 @@ class _CDataBase:
9292
@final
9393
class buffer:
9494
__hash__: ClassVar[None] # type: ignore[assignment]
95-
def __init__(self, *args, **kwargs) -> None: ...
95+
def __new__(cls, *args, **kwargs) -> Self: ...
9696
def __buffer__(self, flags: int, /) -> memoryview: ...
9797
def __delitem__(self, other, /) -> None: ...
9898
def __eq__(self, other, /): ...

stubs/django-filter/@tests/stubtest_allowlist.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Iterator class attributes: Runtime behavior differs due to Django 5.0 compatibility logic in choice setters
2-
django_filters.fields.ChoiceField.iterator
3-
django_filters.fields.ModelChoiceField.iterator
4-
django_filters.fields.ModelMultipleChoiceField.iterator
5-
django_filters.fields.MultipleChoiceField.iterator
6-
71
# Lookup NamedTuple: Parameter name mismatch between inferred stub and runtime
82
django_filters.fields.Lookup.__new__
93
django_filters.fields.Lookup.__doc__
@@ -20,3 +14,7 @@ django_filters.fields.MultipleChoiceField.__init__
2014
django_filters.fields.RangeField.__init__
2115
django_filters.filters.QuerySetRequestMixin.__init__
2216
django_filters.widgets.CSVWidget.__init__
17+
18+
# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
19+
# See https://github.com/python/typeshed/pull/14699
20+
django_filters(\.\w+)*\.OrderingFilter.field_class

stubs/docutils/@tests/stubtest_allowlist.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ docutils.readers.TYPE_CHECKING
3636
docutils.utils.TYPE_CHECKING
3737
docutils.writers.TYPE_CHECKING
3838
docutils.writers._html_base.TYPE_CHECKING
39+
40+
# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
41+
# See https://github.com/python/typeshed/pull/14699
42+
docutils\.nodes\.\w+\.content_model
43+
docutils.parsers.docutils_xml.Unknown.content_model
44+
docutils.transforms.universal.SmartQuotes.nodes_to_skip

stubs/docutils/docutils/nodes.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class Text(Node, str):
112112

113113
# we omit the rawsource parameter because it has been deprecated and is ignored
114114
def __new__(cls, data: str) -> Self: ...
115-
def __init__(self, data: str) -> None: ...
116115
def shortrepr(self, maxlen: int = 18) -> str: ...
117116
def copy(self) -> Self: ...
118117
def deepcopy(self) -> Self: ...

stubs/gevent/gevent/local.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class local:
1111
"_local_type",
1212
"_local_type_set_or_del_descriptors",
1313
)
14-
def __init__(self, *args: object, **kwargs: object) -> None: ...
14+
def __new__(cls, *args: object, **kwargs: object) -> Self: ...
1515
def __copy__(self) -> Self: ...
1616
def __getattribute__(self, name: str, /) -> Any: ...
1717
def __delattr__(self, name: str, /) -> None: ...

stubs/grpcio/grpc/aio/__init__.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ class ServicerContext(Generic[_TRequest, _TResponse], metaclass=abc.ABCMeta):
248248
# Client-Side Interceptor:
249249

250250
class ClientCallDetails(abc.ABC):
251-
def __init__(
252-
self,
251+
def __new__(
252+
_cls,
253253
method: str,
254254
timeout: float | None,
255255
metadata: Metadata | None,
256256
credentials: CallCredentials | None,
257257
wait_for_ready: bool | None,
258-
) -> None: ...
258+
) -> Self: ...
259259

260260
method: str
261261
timeout: float | None

stubs/hvac/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)