Skip to content

Commit 5ecdd63

Browse files
authored
[channels] Compatibility fixes for django-stubs 6.0.3 (#15653)
1 parent eec9fe9 commit 5ecdd63

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

stubs/channels/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version = "4.3.*"
22
upstream-repository = "https://github.com/django/channels"
3-
dependencies = ["django-stubs>=4.2", "asgiref"]
3+
dependencies = ["django-stubs>=6.0.3", "asgiref"]
44

55
[tool.stubtest]
66
mypy-plugins = ['mypy_django_plugin.main']

stubs/channels/channels/auth.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from _typeshed import Incomplete
2+
13
from asgiref.typing import ASGIReceiveCallable, ASGISendCallable
24
from channels.middleware import BaseMiddleware
35
from django.contrib.auth.backends import BaseBackend
@@ -14,7 +16,7 @@ async def logout(scope: _ChannelScope) -> None: ...
1416

1517
# Inherits AbstractBaseUser to improve autocomplete and show this is a lazy proxy for a user.
1618
# At runtime, it's just a LazyObject that wraps the actual user instance.
17-
class UserLazyObject(AbstractBaseUser, LazyObject): ...
19+
class UserLazyObject(AbstractBaseUser, LazyObject[Incomplete]): ...
1820

1921
class AuthMiddleware(BaseMiddleware):
2022
def populate_scope(self, scope: _ChannelScope) -> None: ...

stubs/channels/channels/consumer.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Awaitable
23
from typing import Any, ClassVar, Protocol, TypedDict, type_check_only
34

@@ -11,7 +12,7 @@ from django.utils.functional import LazyObject
1112
# We subclass both for type checking purposes to expose SessionBase attributes,
1213
# and suppress mypy's "misc" error with `# type: ignore[misc]`.
1314
@type_check_only
14-
class _LazySession(SessionBase, LazyObject): # type: ignore[misc]
15+
class _LazySession(SessionBase, LazyObject[Incomplete]): # type: ignore[misc]
1516
_wrapped: SessionBase
1617

1718
@type_check_only

0 commit comments

Comments
 (0)