diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 70fc93cf..2f16212f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b5047cd..ddb10411 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/dramatiq/actor.py b/dramatiq/actor.py index fbca5ea0..200f8288 100644 --- a/dramatiq/actor.py +++ b/dramatiq/actor.py @@ -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: diff --git a/dramatiq/middleware/time_limit.py b/dramatiq/middleware/time_limit.py index 05cd0d38..c0352108 100644 --- a/dramatiq/middleware/time_limit.py +++ b/dramatiq/middleware/time_limit.py @@ -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: @@ -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.") diff --git a/setup.py b/setup.py index 83ac55c6..06c3c69f 100644 --- a/setup.py +++ b/setup.py @@ -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+)", diff --git a/tests/middleware/test_time_limit.py b/tests/middleware/test_time_limit.py index ac1fb82f..ec8d9814 100644 --- a/tests/middleware/test_time_limit.py +++ b/tests/middleware/test_time_limit.py @@ -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([