Skip to content
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 requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Type checkers that we test our stubs against. These should always
# be pinned to a specific version to make failure reproducible.
mypy==1.17.1
mypy==1.18.1
pyright==1.1.405

# Libraries used by our various scripts.
Expand Down
10 changes: 0 additions & 10 deletions stubs/Authlib/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# TODO: check these entries
authlib.jose.drafts._jwe_enc_cryptodome
authlib.oauth2.OAuth2Client.client_auth_class
authlib.oauth2.OAuth2Client.oauth_error_class
authlib.oauth2.OAuth2Client.token_auth_class
authlib.oauth2.client.OAuth2Client.client_auth_class
authlib.oauth2.client.OAuth2Client.oauth_error_class
authlib.oauth2.client.OAuth2Client.token_auth_class
authlib.oauth2.rfc7521.AssertionClient.oauth_error_class
authlib.oauth2.rfc7521.client.AssertionClient.oauth_error_class
authlib.oauth2.rfc7523.JWTBearerTokenValidator.token_cls
authlib.oauth2.rfc7523.validator.JWTBearerTokenValidator.token_cls

# Are set to `None` by default, initialized later:
authlib.jose.drafts._jwe_algorithms.ECDH1PUAlgorithm.description
Expand Down
4 changes: 4 additions & 0 deletions stubs/PyMySQL/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# DictCursorMixin changes method types of inherited classes, but doesn't contain much at runtime
pymysql.cursors.DictCursorMixin.__iter__
pymysql.cursors.DictCursorMixin.fetch[a-z]*

# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
# See https://github.com/python/typeshed/pull/14699
pymysql.connections.Connection.__init__
4 changes: 2 additions & 2 deletions stubs/cffi/_cffi_backend.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import types
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
from collections.abc import Callable, Hashable
from typing import Any, ClassVar, Literal, Protocol, SupportsIndex, TypeVar, final, overload, type_check_only
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias

_T = TypeVar("_T")

Expand Down Expand Up @@ -92,7 +92,7 @@ class _CDataBase:
@final
class buffer:
__hash__: ClassVar[None] # type: ignore[assignment]
def __init__(self, *args, **kwargs) -> None: ...
def __new__(cls, *args, **kwargs) -> Self: ...
def __buffer__(self, flags: int, /) -> memoryview: ...
def __delitem__(self, other, /) -> None: ...
def __eq__(self, other, /): ...
Expand Down
10 changes: 4 additions & 6 deletions stubs/django-filter/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Iterator class attributes: Runtime behavior differs due to Django 5.0 compatibility logic in choice setters
django_filters.fields.ChoiceField.iterator
django_filters.fields.ModelChoiceField.iterator
django_filters.fields.ModelMultipleChoiceField.iterator
django_filters.fields.MultipleChoiceField.iterator

# Lookup NamedTuple: Parameter name mismatch between inferred stub and runtime
django_filters.fields.Lookup.__new__
django_filters.fields.Lookup.__doc__
Expand All @@ -20,3 +14,7 @@ django_filters.fields.MultipleChoiceField.__init__
django_filters.fields.RangeField.__init__
django_filters.filters.QuerySetRequestMixin.__init__
django_filters.widgets.CSVWidget.__init__

# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
# See https://github.com/python/typeshed/pull/14699
django_filters(\.\w+)*\.OrderingFilter.field_class
6 changes: 6 additions & 0 deletions stubs/docutils/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ docutils.readers.TYPE_CHECKING
docutils.utils.TYPE_CHECKING
docutils.writers.TYPE_CHECKING
docutils.writers._html_base.TYPE_CHECKING

# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
# See https://github.com/python/typeshed/pull/14699
docutils\.nodes\.\w+\.content_model
docutils.parsers.docutils_xml.Unknown.content_model
docutils.transforms.universal.SmartQuotes.nodes_to_skip
1 change: 0 additions & 1 deletion stubs/docutils/docutils/nodes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class Text(Node, str):

# we omit the rawsource parameter because it has been deprecated and is ignored
def __new__(cls, data: str) -> Self: ...
def __init__(self, data: str) -> None: ...
def shortrepr(self, maxlen: int = 18) -> str: ...
def copy(self) -> Self: ...
def deepcopy(self) -> Self: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/gevent/gevent/local.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class local:
"_local_type",
"_local_type_set_or_del_descriptors",
)
def __init__(self, *args: object, **kwargs: object) -> None: ...
def __new__(cls, *args: object, **kwargs: object) -> Self: ...
def __copy__(self) -> Self: ...
def __getattribute__(self, name: str, /) -> Any: ...
def __delattr__(self, name: str, /) -> None: ...
Expand Down
6 changes: 3 additions & 3 deletions stubs/grpcio/grpc/aio/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ class ServicerContext(Generic[_TRequest, _TResponse], metaclass=abc.ABCMeta):
# Client-Side Interceptor:

class ClientCallDetails(abc.ABC):
def __init__(
self,
def __new__(
_cls,
method: str,
timeout: float | None,
metadata: Metadata | None,
credentials: CallCredentials | None,
wait_for_ready: bool | None,
) -> None: ...
) -> Self: ...

method: str
timeout: float | None
Expand Down
3 changes: 0 additions & 3 deletions stubs/hvac/@tests/stubtest_allowlist.txt

This file was deleted.

9 changes: 0 additions & 9 deletions stubs/icalendar/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ icalendar.cal.Component.set_inline
# Stubtest gets confused by multiple inheritance.
icalendar.prop.vSkip.__new__
icalendar.vSkip.__new__

# Stubtest incorrectly reports that stub argument "cls" should be
# positional or keyword.
icalendar.vBoolean.__new__
icalendar.vFloat.__new__
icalendar.vInt.__new__
icalendar.prop.vBoolean.__new__
icalendar.prop.vFloat.__new__
icalendar.prop.vInt.__new__
4 changes: 2 additions & 2 deletions stubs/lupa/lupa/lua51.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import MaybeNone
from collections.abc import Callable, Iterable
from typing import Any, Final, Generic, TypeVar, type_check_only
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias

__all__ = [
"LUA_VERSION",
Expand Down Expand Up @@ -78,7 +78,7 @@ class LuaRuntime:
lua_implementation: Final[str]
lua_version: Final[tuple[int, int]]

def __init__(self, /, unpack_returned_tuples: bool) -> None: ...
def __new__(cls, /, unpack_returned_tuples: bool) -> Self: ...
# def add_pending_unref(self, ref: int) -> None: ...
# def clean_up_pending_unrefs(self) -> int: ...
def get_max_memory(self, total: bool = False) -> int | MaybeNone: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/lupa/lupa/lua52.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import MaybeNone
from collections.abc import Callable, Iterable
from typing import Any, Final, Generic, TypeVar, type_check_only
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias

__all__ = [
"LUA_VERSION",
Expand Down Expand Up @@ -78,7 +78,7 @@ class LuaRuntime:
lua_implementation: Final[str]
lua_version: Final[tuple[int, int]]

def __init__(self, /, unpack_returned_tuples: bool) -> None: ...
def __new__(cls, /, unpack_returned_tuples: bool) -> Self: ...
# def add_pending_unref(self, ref: int) -> None: ...
# def clean_up_pending_unrefs(self) -> int: ...
def get_max_memory(self, total: bool = False) -> int | MaybeNone: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/lupa/lupa/lua53.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import MaybeNone
from collections.abc import Callable, Iterable
from typing import Any, Final, Generic, TypeVar, type_check_only
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias

__all__ = [
"LUA_VERSION",
Expand Down Expand Up @@ -78,7 +78,7 @@ class LuaRuntime:
lua_implementation: Final[str]
lua_version: Final[tuple[int, int]]

def __init__(self, /, unpack_returned_tuples: bool) -> None: ...
def __new__(cls, /, unpack_returned_tuples: bool) -> Self: ...
# def add_pending_unref(self, ref: int) -> None: ...
# def clean_up_pending_unrefs(self) -> int: ...
def get_max_memory(self, total: bool = False) -> int | MaybeNone: ...
Expand Down
4 changes: 2 additions & 2 deletions stubs/lupa/lupa/lua54.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import MaybeNone
from collections.abc import Callable, Iterable
from typing import Any, Final, Generic, TypeVar, type_check_only
from typing_extensions import TypeAlias
from typing_extensions import Self, TypeAlias

__all__ = [
"LUA_VERSION",
Expand Down Expand Up @@ -78,7 +78,7 @@ class LuaRuntime:
lua_implementation: Final[str]
lua_version: Final[tuple[int, int]]

def __init__(self, /, unpack_returned_tuples: bool) -> None: ...
def __new__(cls, /, unpack_returned_tuples: bool) -> Self: ...
# def add_pending_unref(self, ref: int) -> None: ...
# def clean_up_pending_unrefs(self) -> int: ...
def get_max_memory(self, total: bool = False) -> int | MaybeNone: ...
Expand Down
3 changes: 0 additions & 3 deletions stubs/networkx/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,3 @@ networkx\._typing
# "..._DT is not present at runtime" but we don't set it in stubs, I don't understand this one
networkx(\.algorithms)?(\.tree)?(\.mst)?\.SpanningTreeIterator\.Partition\._DT
networkx(\.algorithms)?(\.tree)?(\.branchings)?\.ArborescenceIterator\.Partition\._DT

# variable differs from runtime type abc.ABCMeta
networkx\.classes\.reportviews\.\w*EdgeView\.dataview
12 changes: 4 additions & 8 deletions stubs/openpyxl/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ openpyxl.descriptors.nested.NestedMinMax.__get__
openpyxl.descriptors.nested.NestedText.__get__
openpyxl.descriptors.nested.NestedValue.__get__

# Stubtest sees <class T> and type[T] as different: https://github.com/python/mypy/issues/13316
openpyxl.chart.descriptors.NumberFormatDescriptor.expected_type
openpyxl.chart.title.TitleDescriptor.expected_type
openpyxl.drawing.colors.ColorChoiceDescriptor.expected_type
openpyxl.packaging.relationship.RelationshipList.expected_type
openpyxl.styles.colors.ColorDescriptor.expected_type
openpyxl.styles.fills.StopList.expected_type

# Stubtest doesn't like generics here
openpyxl\.descriptors\.(base\.)?Bool\.allow_none
openpyxl\.descriptors\.(base\.)?DateTime\.allow_none
Expand Down Expand Up @@ -195,3 +187,7 @@ openpyxl.worksheet.smart_tag.CellSmartTagPr.__init__
openpyxl.worksheet.smart_tag.CellSmartTags.__init__
openpyxl.worksheet.table.TableColumn.__init__
openpyxl.worksheet.table.XMLColumnProps.__init__

# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
# See https://github.com/python/typeshed/pull/14699
openpyxl.descriptors.sequence.UniqueSequence.seq_types
1 change: 0 additions & 1 deletion stubs/openpyxl/openpyxl/styles/cell_style.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class StyleArray(array[int]):
quotePrefix: ArrayDescriptor[int]
xfId: ArrayDescriptor[int]
def __new__(cls, args: bytes | bytearray | Iterable[int] = [0, 0, 0, 0, 0, 0, 0, 0, 0]) -> Self: ...
def __init__(self, args: bytes | bytearray | Iterable[int] = [0, 0, 0, 0, 0, 0, 0, 0, 0]) -> None: ...
def __hash__(self) -> int: ... # type: ignore[override]
def __copy__(self) -> StyleArray: ...
def __deepcopy__(self, memo: Unused) -> StyleArray: ...
Expand Down
7 changes: 0 additions & 7 deletions stubs/pika/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Stubtest doesn't understand that a property alias is also read-only.
# https://github.com/python/mypy/issues/6700
pika(\.adapters)?(\.blocking_connection)?\.BlockingConnection\.basic_nack
pika(\.adapters)?(\.blocking_connection)?\.BlockingConnection\.consumer_cancel_notify
pika(\.adapters)?(\.blocking_connection)?\.BlockingConnection\.exchange_exchange_bindings
pika(\.adapters)?(\.blocking_connection)?\.BlockingConnection\.publisher_confirms

# The implementation has defaults for the arguments that would make the
# created instances unusable, so we require the arguments in the stub.
pika.spec.Queue.DeclareOk.__init__
Expand Down
27 changes: 14 additions & 13 deletions stubs/protobuf/google/_upb/_message.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from _typeshed import Incomplete
from typing import ClassVar, final
from typing_extensions import Self

default_pool: DescriptorPool

Expand Down Expand Up @@ -28,14 +29,14 @@ class Descriptor:
nested_types_by_name: Incomplete
oneofs: Incomplete
oneofs_by_name: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def CopyToProto(self, object, /): ...
def EnumValueName(self, *args, **kwargs): ... # incomplete
def GetOptions(self): ...

@final
class DescriptorPool:
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def Add(self, object, /): ...
def AddSerializedFile(self, object, /): ...
def FindAllExtensions(self, object, /): ...
Expand All @@ -62,7 +63,7 @@ class EnumDescriptor:
values: Incomplete
values_by_name: Incomplete
values_by_number: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def CopyToProto(self, object, /): ...
def GetOptions(self): ...

Expand All @@ -73,7 +74,7 @@ class EnumValueDescriptor:
name: Incomplete
number: Incomplete
type: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def GetOptions(self): ...

@final
Expand Down Expand Up @@ -151,7 +152,7 @@ class FieldDescriptor:
name: Incomplete
number: Incomplete
type: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def GetOptions(self): ...

@final
Expand All @@ -167,7 +168,7 @@ class FileDescriptor:
public_dependencies: Incomplete
serialized_pb: Incomplete
services_by_name: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def CopyToProto(self, object, /): ...
def GetOptions(self): ...

Expand All @@ -179,7 +180,7 @@ class MapIterator:
@final
class Message:
Extensions: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete # incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def ByteSize(self): ...
def Clear(self): ...
def ClearExtension(self, object, /): ...
Expand Down Expand Up @@ -225,7 +226,7 @@ class MethodDescriptor:
name: Incomplete
output_type: Incomplete
server_streaming: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def CopyToProto(self, object, /): ...
def GetOptions(self): ...

Expand All @@ -237,12 +238,12 @@ class OneofDescriptor:
has_options: Incomplete
index: Incomplete
name: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def GetOptions(self): ...

@final
class RepeatedCompositeContainer:
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def MergeFrom(self, object, /): ...
def add(self, *args, **kwargs): ... # incomplete
def append(self, object, /): ...
Expand All @@ -266,7 +267,7 @@ class RepeatedCompositeContainer:

@final
class RepeatedScalarContainer:
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def MergeFrom(self, object, /): ...
def append(self, object, /): ...
def extend(self, object, /): ...
Expand Down Expand Up @@ -296,14 +297,14 @@ class ServiceDescriptor:
methods: Incomplete
methods_by_name: Incomplete
name: Incomplete
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def CopyToProto(self, object, /): ...
def FindMethodByName(self, object, /): ...
def GetOptions(self): ...

@final
class UnknownFieldSet:
def __init__(self, *args, **kwargs) -> None: ... # incomplete
def __new__(cls, *args, **kwargs) -> Self: ... # incomplete
def __getitem__(self, index, /): ...
def __len__(self) -> int: ...

Expand Down
2 changes: 1 addition & 1 deletion stubs/protobuf/google/protobuf/message.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ class Message:
def ClearField(self, field_name: Any) -> None: ...
def WhichOneof(self, oneof_group: Any) -> Any: ...
# TODO: check kwargs
def __init__(self, *args, **kwargs) -> None: ...
def __new__(cls, *args, **kwargs) -> Self: ...
3 changes: 0 additions & 3 deletions stubs/pyasn1/@tests/stubtest_allowlist.txt

This file was deleted.

4 changes: 4 additions & 0 deletions stubs/pyserial/@tests/stubtest_allowlist_win32.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ serial.tools.list_ports_posix # Posix only
# io.RawIOBase but at runtime they are normal arguments that don't have consistent
# names.
serial.serialwin32.Serial.write

# FIXME: new stubtest errors from mypy v1.18.1 that need to be looked at more closely.
# See https://github.com/python/typeshed/pull/14699
serial.win32.ULONG_PTR
Loading
Loading