Django channels stubs (#13939)

This commit is contained in:
Huy Nguyen
2025-07-12 00:59:58 +07:00
committed by GitHub
parent d5af6bee35
commit 844e132d1e
29 changed files with 688 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
SECRET_KEY = "1"
INSTALLED_APPS = (
"django.contrib.contenttypes",
"django.contrib.sites",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.admin.apps.SimpleAdminConfig",
"django.contrib.staticfiles",
"django.contrib.auth",
"channels",
)
@@ -0,0 +1,15 @@
# channels.auth.UserLazyObject metaclass is mismatch
channels.auth.UserLazyObject
# these one need to be exclude due to mypy error: * is not present at runtime
channels.auth.UserLazyObject.DoesNotExist
channels.auth.UserLazyObject.MultipleObjectsReturned
channels.auth.UserLazyObject@AnnotatedWith
# database_sync_to_async is implemented as a class instance but stubbed as a function
# for better type inference when used as decorator/function
channels.db.database_sync_to_async
# Set to None on class, but initialized to non-None value in __init__
channels.generic.websocket.WebsocketConsumer.groups
channels.generic.websocket.AsyncWebsocketConsumer.groups