diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0e145bdfb..f9f77b096 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -17,7 +17,7 @@ jobs: runs-on: blacksmith-4vcpu-ubuntu-2204 strategy: matrix: - python-version: ["3.12"] + python-version: ["3.13"] steps: - name: Install system packages run: sudo apt-get update && sudo apt-get install libssl-dev diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 81e826520..1b73b7fa8 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] os: ["blacksmith-4vcpu-ubuntu-2204"] steps: @@ -74,7 +74,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] toxenv: [ 'py-amqp', 'py-redis', diff --git a/requirements/extras/gcpubsub.txt b/requirements/extras/gcpubsub.txt index c4c1b3c60..8221bb0c6 100644 --- a/requirements/extras/gcpubsub.txt +++ b/requirements/extras/gcpubsub.txt @@ -1,3 +1,4 @@ -google-cloud-pubsub>=2.18.4,<=2.20.3 +google-cloud-pubsub>=2.18.4 google-cloud-monitoring>=2.16.0 grpcio==1.67.0 +protobuf==4.25.5 diff --git a/t/unit/transport/test_gcpubsub.py b/t/unit/transport/test_gcpubsub.py index 5e60336b6..c617a329e 100644 --- a/t/unit/transport/test_gcpubsub.py +++ b/t/unit/transport/test_gcpubsub.py @@ -9,6 +9,7 @@ from _socket import timeout as socket_timeout from google.api_core.exceptions import (AlreadyExists, DeadlineExceeded, PermissionDenied) +from google.pubsub_v1.types.pubsub import Subscription from kombu.transport.gcpubsub import (AtomicCounter, Channel, QueueDescriptor, Transport, UnackedIds) @@ -283,6 +284,17 @@ def test_create_subscription(self, channel): assert result == subscription_path channel.subscriber.create_subscription.assert_called_once() + def test_create_subscription_protobuf_compat(self): + request = { + 'name': 'projects/my_project/subscriptions/kombu-1111-2222', + 'topic': 'projects/jether-fox/topics/reply.celery.pidbox', + 'ack_deadline_seconds': 240, + 'expiration_policy': {'ttl': '86400s'}, + 'message_retention_duration': '86400s', + 'filter': 'attributes.routing_key="1111-2222"', + } + Subscription(request) + def test_delete(self, channel): queue = "test_queue" subscription_path = "projects/project-id/subscriptions/test_queue" diff --git a/t/unit/transport/test_redis.py b/t/unit/transport/test_redis.py index 2f4d89517..9dd0dd479 100644 --- a/t/unit/transport/test_redis.py +++ b/t/unit/transport/test_redis.py @@ -1326,11 +1326,16 @@ def pipeline(transaction=True, shard_hint=None): channel.qos.restore_by_tag('test-tag') assert mock_execute_command is not None - assert mock_execute_command.mock_calls == [ - call('WATCH', 'foo_unacked'), - call('HGET', 'foo_unacked', 'test-tag'), - call('ZREM', 'foo_unacked_index', 'test-tag'), - call('HDEL', 'foo_unacked', 'test-tag') + # https://github.com/redis/redis-py/pull/3038 (redis>=5.1.0a1) + # adds keyword argument `keys` to redis client. + # To be compatible with all supported redis versions, + # take into account only `call.args`. + call_args = [call.args for call in mock_execute_command.mock_calls] + assert call_args == [ + ('WATCH', 'foo_unacked'), + ('HGET', 'foo_unacked', 'test-tag'), + ('ZREM', 'foo_unacked_index', 'test-tag'), + ('HDEL', 'foo_unacked', 'test-tag') ] diff --git a/tox.ini b/tox.ini index 7b45b9b49..d03e20d8c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = - {pypy3.10,3.8,3.9,3.10,3.11,3.12}-unit - {pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-py-amqp - {pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-redis - {pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-mongodb - {pypy3.10,3.8,3.9,3.10,3.11,3.12}-linux-integration-kafka + {pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-unit + {pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-py-amqp + {pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-redis + {pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-mongodb + {pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13}-linux-integration-kafka flake8 apicheck pydocstyle @@ -21,6 +21,7 @@ python = 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 pypy3: pypy3 [testenv] @@ -32,10 +33,10 @@ passenv = DISTUTILS_USE_SDK deps= -r{toxinidir}/requirements/dev.txt - apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/default.txt - apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test.txt - apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test-ci.txt - apicheck,3.8-linux,3.9-linux,3.10-linux,3.11-linux,3.12-linux: -r{toxinidir}/requirements/extras/confluentkafka.txt + apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/default.txt + apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/test.txt + apicheck,pypy3.10,3.8,3.9,3.10,3.11,3.12,3.13: -r{toxinidir}/requirements/test-ci.txt + 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 apicheck,linkcheck: -r{toxinidir}/requirements/docs.txt flake8,pydocstyle,mypy: -r{toxinidir}/requirements/pkgutils.txt integration: -r{toxinidir}/requirements/test-integration.txt @@ -54,7 +55,8 @@ basepython = 3.10: python3.10 3.11: python3.11 3.12: python3.12 - apicheck,pydocstyle,flake8,linkcheck,cov,mypy: python3.12 + 3.13: python3.13 + apicheck,pydocstyle,flake8,linkcheck,cov,mypy: python3.13 install_command = python -m pip --disable-pip-version-check install {opts} {packages} @@ -162,9 +164,9 @@ setenv = PYTHONDONTWRITEBYTECODE = 1 commands = tox -e \ - 3.12-unit,\ - 3.12-linux-integration-py-amqp,\ - 3.12-linux-integration-redis,\ - 3.12-linux-integration-mongodb,\ - 3.12-linux-integration-kafka \ + 3.13-unit,\ + 3.13-linux-integration-py-amqp,\ + 3.13-linux-integration-redis,\ + 3.13-linux-integration-mongodb,\ + 3.13-linux-integration-kafka \ -p -o -- --exitfirst {posargs}