Skip to content

Commit c48be88

Browse files
authored
Add support for Python 3.13 (#2052)
Fixes #2051.
1 parent e5ea1f6 commit c48be88

File tree

4 files changed

+30
-23
lines changed

4 files changed

+30
-23
lines changed

.github/workflows/linter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: blacksmith-4vcpu-ubuntu-2204
1818
strategy:
1919
matrix:
20-
python-version: ["3.12"]
20+
python-version: ["3.13"]
2121
steps:
2222
- name: Install system packages
2323
run: sudo apt-get update && sudo apt-get install libssl-dev

.github/workflows/python-package.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
36+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
3737
os: ["blacksmith-4vcpu-ubuntu-2204"]
3838

3939
steps:
@@ -74,7 +74,7 @@ jobs:
7474
strategy:
7575
fail-fast: false
7676
matrix:
77-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
77+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
7878
toxenv: [
7979
'py-amqp',
8080
'py-redis',

t/unit/transport/test_redis.py

+10-5
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

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist =
3-
{pypy3.10,3.8,3.9,3.10,3.11,3.12}-unit
4-
{pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-py-amqp
5-
{pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-redis
6-
{pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-mongodb
7-
{pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-kafka
3+
{pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-unit
4+
{pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-py-amqp
5+
{pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-redis
6+
{pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-mongodb
7+
{pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-kafka
88
flake8
99
apicheck
1010
pydocstyle
@@ -21,6 +21,7 @@ python =
2121
3.10: py310
2222
3.11: py311
2323
3.12: py312
24+
3.13: py313
2425
pypy3: pypy3
2526

2627
[testenv]
@@ -32,10 +33,10 @@ passenv =
3233
DISTUTILS_USE_SDK
3334
deps=
3435
-r{toxinidir}/requirements/dev.txt
35-
apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/default.txt
36-
apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test.txt
37-
apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test-ci.txt
38-
apicheck,3.8-linux,3.9-linux,3.10-linux,3.11-linux,3.12-linux: -r{toxinidir}/requirements/extras/confluentkafka.txt
36+
apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/default.txt
37+
apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/test.txt
38+
apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/test-ci.txt
39+
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
3940
apicheck,linkcheck: -r{toxinidir}/requirements/docs.txt
4041
flake8,pydocstyle,mypy: -r{toxinidir}/requirements/pkgutils.txt
4142
integration: -r{toxinidir}/requirements/test-integration.txt
@@ -54,7 +55,8 @@ basepython =
5455
3.10: python3.10
5556
3.11: python3.11
5657
3.12: python3.12
57-
apicheck,pydocstyle,flake8,linkcheck,cov,mypy: python3.12
58+
3.13: python3.13
59+
apicheck,pydocstyle,flake8,linkcheck,cov,mypy: python3.13
5860

5961
install_command = python -m pip --disable-pip-version-check install {opts} {packages}
6062

@@ -162,9 +164,9 @@ setenv =
162164
PYTHONDONTWRITEBYTECODE = 1
163165
commands =
164166
tox -e \
165-
3.12-unit,\
166-
3.12-linux-integration-py-amqp,\
167-
3.12-linux-integration-redis,\
168-
3.12-linux-integration-mongodb,\
169-
3.12-linux-integration-kafka \
167+
3.13-unit,\
168+
3.13-linux-integration-py-amqp,\
169+
3.13-linux-integration-redis,\
170+
3.13-linux-integration-mongodb,\
171+
3.13-linux-integration-kafka \
170172
-p -o -- --exitfirst {posargs}

0 commit comments

Comments
 (0)