Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: '3.14'
python-version: '3.14'
- id: setup-uv
name: Setup UV
uses: astral-sh/setup-uv@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: '${{ matrix.py_version }}'
python-version: '${{ matrix.py_version }}'
- id: setup-uv
name: Setup UV
uses: astral-sh/setup-uv@v7
Expand Down
30 changes: 30 additions & 0 deletions docs/available-components/brokers.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,36 @@ pip install "taskiq[zmq]"

:::

## NNG broker

NNG broker is very much alike to the ZMQ broker. It is as lightweight as ZMQ, but uses NNG as an underlying socket
management solution.

For more information visit their website at [nng.nanomsg.org](https://nng.nanomsg.org/).

::: caution Be careful!
If you choose this type of broker, please run taskiq with `-w 1` parameter,
otherwise you may encounter problems.
:::


::: tabs

@tab Only PyNNG

```bash
pip install pynng
```

@tab Taskiq with NNG

```bash
pip install "taskiq[nng]"
```

:::


## Async shared broker and shared tasks

This is also a special broker. You cannot use it directly. It's used to create shared tasks.
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/message-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ After that, you can use your preferred serializer in your project like this:

```python
from taskiq import InMemoryBroker
from taskiq.serializers import ORJSONSerializer
from taskiq.serializers import ORJSONSerializer

broker = InMemoryBroker().with_serializer(ORJSONSerializer())
```
Expand All @@ -123,7 +123,7 @@ broker = InMemoryBroker().with_serializer(ORJSONSerializer())

```python
from taskiq import InMemoryBroker
from taskiq.serializers import MSGPackSerializer
from taskiq.serializers import MSGPackSerializer

broker = InMemoryBroker().with_serializer(MSGPackSerializer())
```
Expand All @@ -132,7 +132,7 @@ broker = InMemoryBroker().with_serializer(MSGPackSerializer())

```python
from taskiq import InMemoryBroker
from taskiq.serializers import CBORSerializer
from taskiq.serializers import CBORSerializer

broker = InMemoryBroker().with_serializer(CBORSerializer())
```
Expand Down
245 changes: 123 additions & 122 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,87 @@
name = "taskiq"
version = "0.0.0"
description = "Distributed task queue with full async support"
authors = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
maintainers = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
readme = "README.md"
repository = "https://github.com/taskiq-python/taskiq"
homepage = "https://taskiq-python.github.io/"
documentation = "https://taskiq-python.github.io/"
requires-python = ">=3.10,<4"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
maintainers = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
keywords = ["async", "distributed", "taskiq", "tasks"]
classifiers = [
"Typing :: Typed",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: System :: Networking",
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: System :: Networking",
"Typing :: Typed",
]
keywords = ["taskiq", "tasks", "distributed", "async"]
requires-python = ">=3.10,<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",
"aiohttp>=3",
"aiohttp>=3",
"anyio>=4",
"packaging>=19",
"pycron>=3.0.0",
"pydantic>=1.0,<=3.0",
"taskiq_dependencies>=1.3.1,<2",
"typing-extensions>=3.10.0.0; python_version < '3.11'",
]
repository = "https://github.com/taskiq-python/taskiq"
homepage = "https://taskiq-python.github.io/"
documentation = "https://taskiq-python.github.io/"

[project.optional-dependencies]
zmq = ["pyzmq>=26"]
uv = ["uvloop>=0.16.0,<1; sys_platform != 'win32'"]
cbor = ["cbor2>=5"]
metrics = ["prometheus_client>=0"]
reload = ["watchdog>=4", "gitignore-parser>=0"]
orjson = ["orjson>=3"]
msgpack = ["msgpack>=1.0.7"]
cbor = ["cbor2>=5"]
nng = [
"pynng>=0.9.0,<1",
]
opentelemetry = [
"opentelemetry-api (>=1.38.0,<2.0.0)",
"opentelemetry-instrumentation (>=0.59b0,<1)",
"opentelemetry-semantic-conventions (>=0.59b0,<1)",
"opentelemetry-api (>=1.38.0,<2.0.0)",
"opentelemetry-instrumentation (>=0.59b0,<1)",
"opentelemetry-semantic-conventions (>=0.59b0,<1)",
]
orjson = ["orjson>=3"]
reload = ["watchdog>=4", "gitignore-parser>=0"]
uv = ["uvloop>=0.16.0,<1; sys_platform != 'win32'"]
zmq = ["pyzmq>=26"]

[dependency-groups]
dev = [
"pre-commit>=4.4.0",
# lint
"ruff>=0.14.5",
"black>=25.11.0",
# type check
"mypy>=1.18.2",
# test
"pytest>=9.0.1",
"pytest-cov>=7.0.0",
"coverage>=7.11.3",
"pytest-xdist[psutil]>=3.8.0",
"freezegun>=1.5.5",
"tzdata>=2025.2; sys_platform == 'win32'",
"opentelemetry-test-utils (>=0.59b0,<1)",
"polyfactory>=3.1.0",
# tests with all python versions
"tox>=4.32.0",
"tox-uv>=1.29.0",
"black>=25.11.0",
"coverage>=7.11.3",
"freezegun>=1.5.5",
# type check
"mypy>=1.18.2",
"opentelemetry-test-utils (>=0.59b0,<1)",
"polyfactory>=3.1.0",
"pre-commit>=4.4.0",
# test
"pytest>=9.0.1",
"pytest-cov>=7.0.0",
"pytest-xdist[psutil]>=3.8.0",
# lint
"ruff>=0.14.5",
# tests with all python versions
"tox>=4.32.0",
"tox-uv>=1.29.0",
"tzdata>=2025.2; sys_platform == 'win32'",
]

[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"
Documentation = "https://taskiq-python.github.io/"
Homepage = "https://taskiq-python.github.io/"
Repository = "https://github.com/taskiq-python/taskiq"

[project.scripts]
taskiq = "taskiq.__main__:main"
Expand Down Expand Up @@ -109,19 +112,19 @@ profile = "black"
multi_line_output = 3

[tool.pytest.ini_options]
log_level = 'INFO'
log_level = "INFO"
anyio_mode = "auto"

[tool.coverage.run]
omit = [
"taskiq/__main__.py",
"taskiq/abc/cmd.py",
"taskiq/cli/scheduler/args.py",
"taskiq/cli/scheduler/cmd.py",
"taskiq/cli/utils.py",
"taskiq/cli/worker/args.py",
"taskiq/cli/worker/async_task_runner.py",
"taskiq/cli/worker/cmd.py",
"taskiq/__main__.py",
"taskiq/abc/cmd.py",
"taskiq/cli/scheduler/args.py",
"taskiq/cli/scheduler/cmd.py",
"taskiq/cli/utils.py",
"taskiq/cli/worker/args.py",
"taskiq/cli/worker/async_task_runner.py",
"taskiq/cli/worker/cmd.py",
]

[build-system]
Expand All @@ -133,74 +136,74 @@ module-name = "taskiq"
module-root = ""

[tool.ruff]
target-version="py310"
target-version = "py310"
# List of enabled rulsets.
# See https://docs.astral.sh/ruff/rules/ for more information.
lint.select = [
"E", # Error
"F", # Pyflakes
"W", # Pycodestyle
"C90", # McCabe complexity
"I", # Isort
"N", # pep8-naming
"D", # Pydocstyle
"ANN", # Pytype annotations
"S", # Bandit
"B", # Bugbear
"COM", # Commas
"C4", # Comprehensions
"ISC", # Implicit string concat
"PIE", # Unnecessary code
"T20", # Catch prints
"PYI", # validate pyi files
"Q", # Checks for quotes
"RSE", # Checks raise statements
"RET", # Checks return statements
"SLF", # Self checks
"SIM", # Simplificator
"PTH", # Pathlib checks
"ERA", # Checks for commented out code
"PL", # PyLint checks
"RUF", # Specific to Ruff checks
"FA102", # Future annotations
"UP", # Pyupgrade
"E", # Error
"F", # Pyflakes
"W", # Pycodestyle
"C90", # McCabe complexity
"I", # Isort
"N", # pep8-naming
"D", # Pydocstyle
"ANN", # Pytype annotations
"S", # Bandit
"B", # Bugbear
"COM", # Commas
"C4", # Comprehensions
"ISC", # Implicit string concat
"PIE", # Unnecessary code
"T20", # Catch prints
"PYI", # validate pyi files
"Q", # Checks for quotes
"RSE", # Checks raise statements
"RET", # Checks return statements
"SLF", # Self checks
"SIM", # Simplificator
"PTH", # Pathlib checks
"ERA", # Checks for commented out code
"PL", # PyLint checks
"RUF", # Specific to Ruff checks
"FA102", # Future annotations
"UP", # Pyupgrade
]
lint.ignore = [
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D212", # Multi-line docstring summary should start at the first line
"D401", # First line should be in imperative mood
"D104", # Missing docstring in public package
"D100", # Missing docstring in public module
"ANN401", # typing.Any are disallowed in `**kwargs
"PLR0913", # Too many arguments for function call
"D106", # Missing docstring in public nested class
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D212", # Multi-line docstring summary should start at the first line
"D401", # First line should be in imperative mood
"D104", # Missing docstring in public package
"D100", # Missing docstring in public module
"ANN401", # typing.Any are disallowed in `**kwargs
"PLR0913", # Too many arguments for function call
"D106", # Missing docstring in public nested class
]
lint.mccabe = { max-complexity = 10 }
exclude = [".venv/"]
line-length = 88

[tool.ruff.lint.per-file-ignores]
"taskiq/compat.py" = [
"D103", # Missing docstring in public function
"D103", # Missing docstring in public function
]
"tests/*" = [
"S101", # Use of assert detected
"S301", # Use of pickle detected
"D103", # Missing docstring in public function
"SLF001", # Private member accessed
"S311", # Standard pseudo-random generators are not suitable for security/cryptographic purposes
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"PLR2004", # Magic value
"S101", # Use of assert detected
"S301", # Use of pickle detected
"D103", # Missing docstring in public function
"SLF001", # Private member accessed
"S311", # Standard pseudo-random generators are not suitable for security/cryptographic purposes
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"PLR2004", # Magic value
]
"docs/examples/*" = [
"D103", # Missing docstring in public function
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"S311", # Standard pseudo-random generators
"S101", # use of asserts detected
"T201", # print found
"D103", # Missing docstring in public function
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"S311", # Standard pseudo-random generators
"S101", # use of asserts detected
"T201", # print found
]

[tool.ruff.lint.pydocstyle]
Expand All @@ -215,7 +218,7 @@ extend-immutable-calls = ["taskiq_dependencies.Depends", "taskiq.TaskiqDepends"]

[tool.typos.files]
extend-exclude = [
"docs/README.md", # because of identifier in head section
"docs/README.md", # because of identifier in head section
]

[tool.tox]
Expand All @@ -227,6 +230,4 @@ env_list = ["3.13", "3.12", "3.11", "3.10"]
description = "Run tests with Python {base_python}"
runner = "uv-venv-lock-runner"
uv_sync_flags = ["--all-extras"]
commands = [
["pytest", "-vv", "-n", "auto"]
]
commands = [["pytest", "-vv", "-n", "auto"]]
Loading
Loading