Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 2 additions & 105 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

129 changes: 70 additions & 59 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
[tool.poetry]
[project]
name = "taskiq"
version = "0.0.0"
description = "Distributed task queue with full async support"
authors = ["Pavel Kirilin <[email protected]>"]
maintainers = ["Pavel Kirilin <[email protected]>"]
authors = [
{name = "Pavel Kirilin", email = "<[email protected]>"}
]
maintainers = [
{name = "Pavel Kirilin", email = "<[email protected]>"}
]
readme = "README.md"
repository = "https://github.com/taskiq-python/taskiq"
homepage = "https://taskiq-python.github.io/"
documentation = "https://taskiq-python.github.io/"
license = "LICENSE"
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Typing :: Typed",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -26,63 +30,70 @@ classifiers = [
"Development Status :: 3 - Alpha",
]
keywords = ["taskiq", "tasks", "distributed", "async"]
requires-python = ">=3.9,<4"
dependencies = [
"typing-extensions>=3.10.0.0; python_version < '3.11'",
"pydantic>=1.0,<=3.0",
"pycron>=3.0.0",
"taskiq_dependencies>=1.3.1,<2",
"anyio>=4",
"packaging>=19",
"izulu==0.50.0",
"aiohttp>=3",
]

[project.optional-dependencies]
zmq = [
"pyzmq>=26",
]
uv = [
"uvloop>=0.16.0,<1; sys_platform != 'win32'",
]
metrics = [
"prometheus_client>=0",
]
reload = [
"watchdog>=4",
"gitignore-parser>=0",
]
orjson = [
"orjson>=3",
]
msgpack = [
"msgpack>=1.0.7",
]
cbor = [
"cbor2>=5",
]

[dependency-groups]
dev = [
"pre-commit>=4.3.0",
# lint
"ruff>=0",
"black>=22.6.0",
# type check
"mypy>=1",
# test
"pytest>=7.1.2",
"pytest-cov>=3.0.0",
"coverage>=6.4.2",
"pytest-xdist[psutil]>=2.5.0",
"tox>=4.6.4",
"freezegun>=1.2.2",
]

[project.urls]
Homepage = "https://taskiq-python.github.io/"
Documentation = "https://taskiq-python.github.io/"
Repository = "https://github.com/taskiq-python/taskiq"
"Bug Tracker" = "https://github.com/taskiq-python/taskiq/issues"
Changelog = "https://github.com/taskiq-python/taskiq/releases"

[tool.poetry.dependencies]
python = "^3.9"
typing-extensions = ">=3.10.0.0"
pydantic = ">=1.0,<=3.0"
importlib-metadata = "*"
pycron = "^3.0.0"
taskiq_dependencies = ">=1.3.1,<2"
anyio = ">=4"
packaging = ">=19"
# For prometheus metrics
prometheus_client = { version = "^0", optional = true }
# For ZMQBroker
pyzmq = { version = "^26", optional = true }
# For speed
uvloop = { version = ">=0.16.0,<1", optional = true, markers = "sys_platform != 'win32'" }
# For hot-reload.
watchdog = { version = "^4", optional = true }
gitignore-parser = { version = "^0", optional = true }
pytz = "*"
orjson = { version = "^3", optional = true }
msgpack = { version = "^1.0.7", optional = true }
cbor2 = { version = "^5", optional = true }
izulu = "0.50.0"
aiohttp = "^3"

[tool.poetry.group.dev.dependencies]
pytest = "^7.1.2"
ruff = "^0"
black = { version = "^22.6.0", allow-prereleases = true }
mypy = "^1"
pre-commit = "^4.3.0"
coverage = "^6.4.2"
pytest-cov = "^3.0.0"
mock = "^4.0.3"
pytest-xdist = { version = "^2.5.0", extras = ["psutil"] }
types-mock = "^4.0.15"
tox = "^4.6.4"
freezegun = "^1.2.2"
pytest-mock = "^3.11.1"
tzlocal = "^5.0.1"
types-tzlocal = "^5.0.1.1"
types-pytz = "^2023.3.1.1"

[tool.poetry.extras]
zmq = ["pyzmq"]
uv = ["uvloop"]
metrics = ["prometheus_client"]
reload = ["watchdog", "gitignore-parser"]
orjson = ["orjson"]
msgpack = ["msgpack"]
cbor = ["cbor2"]

[tool.poetry.scripts]
[project.scripts]
taskiq = "taskiq.__main__:main"

[tool.poetry.plugins.taskiq_cli]
[project.entry-points.taskiq_cli]
worker = "taskiq.cli.worker.cmd:WorkerCMD"
scheduler = "taskiq.cli.scheduler.cmd:SchedulerCMD"

Expand Down
3 changes: 1 addition & 2 deletions taskiq/__main__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import argparse
import sys
from importlib.metadata import entry_points
from typing import Dict

from importlib_metadata import entry_points

from taskiq import __version__
from taskiq.abc.cmd import TaskiqCMD

Expand Down
12 changes: 10 additions & 2 deletions taskiq/abc/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
)
from uuid import uuid4

from typing_extensions import ParamSpec, Self, TypeAlias

from taskiq.abc.middleware import TaskiqMiddleware
from taskiq.abc.serializer import TaskiqSerializer
from taskiq.acks import AckableMessage
Expand All @@ -39,6 +37,16 @@
from taskiq.utils import maybe_awaitable, remove_suffix
from taskiq.warnings import TaskiqDeprecationWarning

if sys.version_info >= (3, 11):
from typing import ParamSpec, Self, TypeAlias
elif sys.version_info >= (3, 10):
from typing import ParamSpec, TypeAlias

from typing_extensions import Self
else:
from typing_extensions import ParamSpec, Self, TypeAlias


if TYPE_CHECKING: # pragma: no cover
from taskiq.abc.formatter import TaskiqFormatter
from taskiq.abc.result_backend import AsyncResultBackend
Expand Down
9 changes: 7 additions & 2 deletions taskiq/brokers/shared_broker.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import sys
from typing import Any, AsyncGenerator, Optional, TypeVar

from typing_extensions import ParamSpec

from taskiq.abc.broker import AsyncBroker
from taskiq.decor import AsyncTaskiqDecoratedTask
from taskiq.exceptions import SharedBrokerListenError, SharedBrokerSendTaskError
from taskiq.kicker import AsyncKicker
from taskiq.message import BrokerMessage

if sys.version_info >= (3, 10):
from typing import ParamSpec
else:
from typing_extensions import ParamSpec


_ReturnType = TypeVar("_ReturnType")
_Params = ParamSpec("_Params")

Expand Down
Loading
Loading