Skip to content

Commit

Permalink
Merge branch 'main' into blm-380-2
Browse files Browse the repository at this point in the history
  • Loading branch information
thedrow authored Oct 24, 2024
2 parents a809375 + c48be88 commit caf2c95
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion requirements/extras/gcpubsub.txt
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions t/unit/transport/test_gcpubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down
15 changes: 10 additions & 5 deletions t/unit/transport/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
]


Expand Down
32 changes: 17 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,6 +21,7 @@ python =
3.10: py310
3.11: py311
3.12: py312
3.13: py313
pypy3: pypy3

[testenv]
Expand All @@ -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
Expand All @@ -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}

Expand Down Expand Up @@ -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}

0 comments on commit caf2c95

Please sign in to comment.