Skip to content

Commit 5825b9a

Browse files
authored
feat: declare python 3.14 support (#562)
1 parent faf26a2 commit 5825b9a

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
pytest:
4040
strategy:
4141
matrix:
42-
py_version: ["3.10", "3.11", "3.12", "3.13"]
42+
py_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4343
pydantic_ver: ["<2", ">=2.5,<3"]
4444
os: [ubuntu-latest, windows-latest, macos-latest]
4545
runs-on: "${{ matrix.os }}"

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ classifiers = [
1919
"Programming Language :: Python :: 3.11",
2020
"Programming Language :: Python :: 3.12",
2121
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
2223
"Operating System :: OS Independent",
2324
"Intended Audience :: Developers",
2425
"Topic :: System :: Networking",

taskiq/receiver/receiver.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import contextvars
33
import functools
44
import inspect
5+
import sys
56
from collections.abc import Callable
67
from concurrent.futures import Executor
78
from logging import getLogger
@@ -23,6 +24,7 @@
2324
from taskiq.utils import maybe_awaitable
2425

2526
logger = getLogger(__name__)
27+
PY_VERSION = sys.version_info
2628
QUEUE_DONE = b"-1"
2729

2830

@@ -224,6 +226,11 @@ async def run_task( # noqa: C901, PLR0912, PLR0915
224226
# Start a timer.
225227
start_time = time()
226228

229+
check_coroutine_func = (
230+
asyncio.iscoroutinefunction
231+
if PY_VERSION <= (3, 13)
232+
else inspect.iscoroutinefunction
233+
)
227234
try:
228235
# We put kwargs resolving here,
229236
# to be able to catch any exception (for example ),
@@ -234,7 +241,7 @@ async def run_task( # noqa: C901, PLR0912, PLR0915
234241
kwargs.update(message.kwargs)
235242
is_coroutine = True
236243
# If the function is a coroutine, we await it.
237-
if asyncio.iscoroutinefunction(target):
244+
if check_coroutine_func(target):
238245
target_future = target(*message.args, **kwargs)
239246
else:
240247
is_coroutine = False

0 commit comments

Comments
 (0)