Include celery-types
This commit is contained in:
parent
60d34bdf0d
commit
8b571dac93
2 changed files with 29 additions and 0 deletions
|
|
@ -1,6 +1,34 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from celery import Celery
|
from celery import Celery
|
||||||
|
from celery import Signature
|
||||||
|
from celery.app.task import Task
|
||||||
|
from celery.contrib.abortable import AbortableAsyncResult
|
||||||
|
from celery.contrib.abortable import AbortableTask
|
||||||
|
from celery.contrib.django.task import DjangoTask
|
||||||
|
from celery.local import class_property
|
||||||
|
from celery.result import AsyncResult
|
||||||
|
from celery.utils.objects import FallbackContext
|
||||||
|
|
||||||
|
classes = [
|
||||||
|
Celery,
|
||||||
|
Task,
|
||||||
|
DjangoTask,
|
||||||
|
AbortableTask,
|
||||||
|
AsyncResult,
|
||||||
|
AbortableAsyncResult,
|
||||||
|
Signature,
|
||||||
|
FallbackContext,
|
||||||
|
class_property,
|
||||||
|
]
|
||||||
|
|
||||||
|
for cls in classes:
|
||||||
|
setattr( # noqa: B010
|
||||||
|
cls,
|
||||||
|
"__class_getitem__",
|
||||||
|
classmethod(lambda cls, *args, **kwargs: cls), # noqa: ARG005
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Set the default Django settings module for the 'celery' program.
|
# Set the default Django settings module for the 'celery' program.
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ dependencies = [
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = [
|
dev = [
|
||||||
|
"celery-types",
|
||||||
"django-stubs",
|
"django-stubs",
|
||||||
"djlint",
|
"djlint",
|
||||||
"hypothesis[django]",
|
"hypothesis[django]",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue