Skip to content

Commit

Permalink
chore: remove check celery < 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WaYdotNET committed Dec 4, 2023
1 parent eefeab4 commit d8b703c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions celery_pubsub/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d8b703c

Please sign in to comment.