Skip to content

Commit d26e891

Browse files
committed
Add support for Python 3.13
Fixes #2051.
1 parent 4fb7246 commit d26e891

File tree

6 files changed

+37
-18
lines changed

6 files changed

+37
-18
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
9+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1010
exclude:
1111
- python-version: "3.9"
1212
steps:
@@ -19,6 +19,10 @@ jobs:
1919
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
22+
allow-prereleases: true
23+
- name: Allow pre-releases in tox on Python 3.13
24+
run: echo "PIP_PRE=1" >> $GITHUB_ENV
25+
if: ${{ matrix.python-version == '3.13' }}
2226
- name: Install dependencies
2327
run: pip install --upgrade pip wheel tox tox-docker
2428
- name: Run unittest
@@ -31,7 +35,7 @@ jobs:
3135
strategy:
3236
fail-fast: false
3337
matrix:
34-
python-version: [3.8,3.9,"3.10","3.11","3.12"]
38+
python-version: [3.8,3.9,"3.10","3.11","3.12","3.13"]
3539
experimental: [false]
3640
include:
3741
- python-version: pypy3.9
@@ -46,6 +50,10 @@ jobs:
4650
uses: actions/setup-python@v5
4751
with:
4852
python-version: ${{ matrix.python-version }}
53+
allow-prereleases: true
54+
- name: Allow pre-releases in tox on Python 3.13
55+
run: echo "PIP_PRE=1" >> $GITHUB_ENV
56+
if: ${{ matrix.python-version == '3.13' }}
4957
- name: Install dependencies
5058
run: pip install --upgrade pip wheel tox tox-docker
5159
# Tox fails if a Python versions contains a hyphen, this changes "pypy-3.9" to "pypy3.9".
@@ -76,6 +84,10 @@ jobs:
7684
uses: actions/setup-python@v5
7785
with:
7886
python-version: ${{ matrix.python-version }}
87+
allow-prereleases: true
88+
- name: Allow pre-releases in tox on Python 3.13
89+
run: echo "PIP_PRE=1" >> $GITHUB_ENV
90+
if: ${{ matrix.python-version == '3.13' }}
7991
- name: Install dependencies
8092
run: pip install --upgrade pip wheel tox tox-docker
8193
- name: Run flake8

kombu/transport/redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090

9191
logger = get_logger('kombu.transport.redis')
92-
crit, warn = logger.critical, logger.warn
92+
crit, warn = logger.critical, logger.warning
9393

9494
DEFAULT_PORT = 6379
9595
DEFAULT_DB = 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
confluent-kafka>=2.2.0
1+
confluent-kafka>=2.2.0 ; python_version < "3.13"

requirements/extras/zstd.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
zstandard
1+
zstandard ; python_version < "3.13"

t/unit/transport/test_redis.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,11 +1326,16 @@ def pipeline(transaction=True, shard_hint=None):
13261326

13271327
channel.qos.restore_by_tag('test-tag')
13281328
assert mock_execute_command is not None
1329-
assert mock_execute_command.mock_calls == [
1330-
call('WATCH', 'foo_unacked'),
1331-
call('HGET', 'foo_unacked', 'test-tag'),
1332-
call('ZREM', 'foo_unacked_index', 'test-tag'),
1333-
call('HDEL', 'foo_unacked', 'test-tag')
1329+
# https://github.com/redis/redis-py/pull/3038 (redis>=5.1.0a1)
1330+
# adds keyword argument `keys` to redis client.
1331+
# To be compatible with all supported redis versions,
1332+
# take into account only `call.args`.
1333+
call_args = [call.args for call in mock_execute_command.mock_calls]
1334+
assert call_args == [
1335+
('WATCH', 'foo_unacked'),
1336+
('HGET', 'foo_unacked', 'test-tag'),
1337+
('ZREM', 'foo_unacked_index', 'test-tag'),
1338+
('HDEL', 'foo_unacked', 'test-tag')
13341339
]
13351340

13361341

tox.ini

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist =
3-
{pypy3.9,3.8,3.9,3.10,3.11,3.12}-unit
4-
{pypy3.9,3.8,3.9,3.10,3.11,3.12}-linux-integration-py-amqp
3+
{pypy3.9,3.8,3.9,3.10,3.11,3.12,3.13}-unit
4+
{pypy3.9,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-py-amqp
55
{pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-redis
66
{pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-mongodb
7-
{3.8,3.9,3.10,3.11,3.12}-linux-integration-kafka
7+
{3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-kafka
88
flake8
99
apicheck
1010
pydocstyle
@@ -20,6 +20,7 @@ python =
2020
3.10: py310, mypy
2121
3.11: py311
2222
3.12: py312
23+
3.13: py313
2324

2425
[testenv]
2526
sitepackages = False
@@ -28,10 +29,10 @@ passenv =
2829
DISTUTILS_USE_SDK
2930
deps=
3031
-r{toxinidir}/requirements/dev.txt
31-
apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/default.txt
32-
apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test.txt
33-
apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test-ci.txt
34-
apicheck,3.8-linux,3.9-linux,3.10-linux,3.11-linux,3.12-linux: -r{toxinidir}/requirements/extras/confluentkafka.txt
32+
apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/default.txt
33+
apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/test.txt
34+
apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/test-ci.txt
35+
apicheck,3.8-linux,3.9-linux,3.10-linux,3.11-linux,3.12-linux,3.13-linux: -r{toxinidir}/requirements/extras/confluentkafka.txt
3536
apicheck,linkcheck: -r{toxinidir}/requirements/docs.txt
3637
flake8,pydocstyle,mypy: -r{toxinidir}/requirements/pkgutils.txt
3738

@@ -50,6 +51,7 @@ basepython =
5051
3.10,apicheck,pydocstyle,flake8,linkcheck,cov,mypy: python3.10
5152
3.11: python3.11
5253
3.12: python3.12
54+
3.13: python3.13
5355

5456
install_command = python -m pip --disable-pip-version-check install {opts} {packages}
5557

@@ -135,4 +137,4 @@ commands =
135137
pydocstyle {toxinidir}/kombu
136138

137139
[testenv:mypy]
138-
commands = python -m mypy --config-file setup.cfg
140+
commands = python -m mypy --config-file setup.cfg

0 commit comments

Comments
 (0)