From d8b703cdbc0efa1ce8b4f37b1cf74fd8ab3f649a Mon Sep 17 00:00:00 2001 From: Carlo Bertini Date: Sun, 3 Dec 2023 18:40:57 +0100 Subject: [PATCH] chore: remove check celery < 4.0.0 --- celery_pubsub/pubsub.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/celery_pubsub/pubsub.py b/celery_pubsub/pubsub.py index 75ad025..2cd45c9 100644 --- a/celery_pubsub/pubsub.py +++ b/celery_pubsub/pubsub.py @@ -5,8 +5,6 @@ import re import typing -from pkg_resources import get_distribution, parse_version - if typing.TYPE_CHECKING: # pragma: no cover from typing_extensions import TypeAlias else: @@ -35,12 +33,7 @@ P: TypeAlias = typing.Any # ParamSpec R: TypeAlias = typing.Any # Return type -task: typing.Callable[..., typing.Callable[[typing.Callable[[P], R]], Task[P, R]]] - -if get_distribution("celery").parsed_version < parse_version("4.0.0"): - task = celery.task # type: ignore -else: - task = celery.shared_task +task: typing.Callable[..., typing.Callable[[typing.Callable[[P], R]], Task[P, R]]] = celery.shared_task class PubSubManager: