Skip to content

Commit 79c588a

Browse files
committed
fix(worker): use new event loop for Python 3.14+
Switches to asyncio.new_event_loop() for Python 3.14 and above, as asyncio.get_event_loop() is deprecated. Maintains compatibility with older Python versions by conditionally selecting the event loop method. Incorporated fix from python-arq#509 by https://github.com/a3lme Bump version to 0.27.1 Rename to tomfaulkner-arq.
1 parent fda407c commit 79c588a

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
History
44
-------
55

6+
v0.27.1 (2026-02-21)
7+
....................
8+
* Apply 3.14 patch by @Viicos in #515
9+
* Incorporing fix from https://github.com/python-arq/arq/pull/509 by https://github.com/a3lme
10+
611
v0.27.0 (2026-01-30)
712
....................
813

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@
1212
Job queues in python with asyncio and redis.
1313

1414
See [documentation](https://arq-docs.helpmanual.io/) for more details.
15+
16+
# TomFaulkner Fork
17+
Patched support for Python 3.14, bumped version.

arq/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Version here is used for the package version via the `[tool.hatch.version]` section of `pyproject.toml`.
2-
VERSION = '0.27.0'
2+
VERSION = '0.27.1'

arq/worker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import inspect
44
import logging
55
import signal
6+
import sys
67
from collections.abc import Sequence
78
from dataclasses import dataclass
89
from datetime import datetime, timedelta, timezone
@@ -267,7 +268,7 @@ def __init__(
267268
# self.job_tasks holds references the actual jobs running
268269
self.job_tasks: dict[str, asyncio.Task[Any]] = {}
269270
self.main_task: Optional[asyncio.Task[None]] = None
270-
self.loop = asyncio.get_event_loop()
271+
self.loop = asyncio.get_event_loop() if sys.version_info < (3, 14) else asyncio.new_event_loop()
271272
self.ctx = ctx or {}
272273
max_timeout = max(f.timeout_s or self.job_timeout_s for f in self.functions.values())
273274
self.in_progress_timeout_s = (max_timeout or 0) + 10

pyproject.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ build-backend = 'hatchling.build'
55
[tool.hatch.version]
66
path = 'arq/version.py'
77

8+
[tool.hatch.build.targets.wheel]
9+
packages = ["arq"]
10+
811
[project]
9-
name = 'arq'
12+
name = 'tomfaulkner-arq'
1013
description = 'Job queues in python with asyncio and redis'
1114
authors = [{name = 'Samuel Colvin', email = 's@muelcolvin.com'}]
1215
license = { text = 'MIT' }
@@ -29,6 +32,7 @@ classifiers = [
2932
'Programming Language :: Python :: 3.11',
3033
'Programming Language :: Python :: 3.12',
3134
'Programming Language :: Python :: 3.13',
35+
'Programming Language :: Python :: 3.14',
3236
'Topic :: Internet',
3337
'Topic :: Software Development :: Libraries :: Python Modules',
3438
'Topic :: System :: Clustering',
@@ -50,11 +54,11 @@ watch = ['watchfiles>=0.16']
5054
arq = 'arq.cli:cli'
5155

5256
[project.urls]
53-
Homepage = 'https://github.com/python-arq/arq'
57+
Homepage = 'https://github.com/TomFaulkner/arq'
5458
Documentation = 'https://arq-docs.helpmanual.io'
5559
Funding = 'https://github.com/sponsors/samuelcolvin'
56-
Source = 'https://github.com/python-arq/arq'
57-
Changelog = 'https://github.com/python-arq/arq/releases'
60+
Source = 'https://github.com/TomFaulkner/arq'
61+
Changelog = 'https://github.com/TomFaulkner/arq/releases'
5862

5963
[dependency-groups]
6064
testing = [

0 commit comments

Comments
 (0)