Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #656 -- Add Python 3.13 support #659

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"
- run: |
sudo apt-get update
sudo apt-get remove libhashkit2 libmemcached11 || true
Expand All @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-20.04"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
concurrency: ["cpython", "gevent"]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
python-version: "3.13"

- name: Install dependencies
run: python -m pip install build
Expand Down
2 changes: 1 addition & 1 deletion dramatiq/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def send_with_options(
message = self.message_with_options(args=args, kwargs=kwargs, **options)
return self.broker.enqueue(message, delay=delay)

def __call__(self, *args: P.args, **kwargs: P.kwargs) -> R:
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> Any | R | Awaitable[R]:
"""Synchronously call this actor.

Parameters:
Expand Down
4 changes: 2 additions & 2 deletions dramatiq/middleware/time_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, interval, logger=None):
self.logger = logger or get_logger(__name__, type(self))
self.mu = threading.RLock()

def _handle(self):
def _handle_deadlines(self):
current_time = monotonic()
threads_to_kill = []
with self.mu:
Expand All @@ -110,7 +110,7 @@ def _handle(self):
def run(self):
while True:
try:
self._handle()
self._handle_deadlines()
except Exception: # pragma: no cover
self.logger.exception("Unhandled error while running the time limit handler.")

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def rel(*xs):
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: System :: Distributed Computing",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
Expand Down
2 changes: 1 addition & 1 deletion tests/middleware/test_time_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_time_limit_exceeded_worker_messages(raise_thread_exception, caplog):
1: current_time - 2, 2: current_time - 1, 3: current_time + 50000}

# When the time limit handler is triggered
middleware.manager._handle()
middleware.manager._handle_deadlines()

# TimeLimitExceeded interrupts are raised in two of the threads
raise_thread_exception.assert_has_calls([
Expand Down
Loading