Skip to content

Commit

Permalink
Fix #656 -- Add Python 3.13 support
Browse files Browse the repository at this point in the history
`threading.Thread` received a new `_handle` attribute in Python 3.13, which clashes with dramatiq's `_CtypesTimeoutManager(Thread)` class. This commit renames the dramatiq method to resolve the conflict.

It also adds Python 3.13 to CI and package classification
  • Loading branch information
amureki committed Oct 25, 2024
1 parent 3e20bdd commit 94dcb33
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
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
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

0 comments on commit 94dcb33

Please sign in to comment.