From 85abaa635aae7422d0a98440042a25b5b5d8b3f0 Mon Sep 17 00:00:00 2001 From: Asif Saif Uddin Date: Mon, 6 Nov 2023 18:13:27 +0600 Subject: [PATCH] Bump kafka deps versions & fix integration test failures (#1818) * Bump kafka deps versions * adjust import * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added missing tox python 3.12 env for kafka --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- kombu/transport/confluentkafka.py | 5 +++-- requirements/extras/confluentkafka.txt | 2 +- tox.ini | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/kombu/transport/confluentkafka.py b/kombu/transport/confluentkafka.py index 5332a310..9f52d573 100644 --- a/kombu/transport/confluentkafka.py +++ b/kombu/transport/confluentkafka.py @@ -69,7 +69,8 @@ from kombu.utils.json import dumps, loads try: import confluent_kafka - from confluent_kafka import Consumer, Producer, TopicPartition + from confluent_kafka import (Consumer, KafkaException, Producer, + TopicPartition) from confluent_kafka.admin import AdminClient, NewTopic KAFKA_CONNECTION_ERRORS = () @@ -86,7 +87,7 @@ logger = get_logger(__name__) DEFAULT_PORT = 9092 -class NoBrokersAvailable(confluent_kafka.KafkaException): +class NoBrokersAvailable(KafkaException): """Kafka broker is not available exception.""" retriable = True diff --git a/requirements/extras/confluentkafka.txt b/requirements/extras/confluentkafka.txt index f41aacd9..746267a8 100644 --- a/requirements/extras/confluentkafka.txt +++ b/requirements/extras/confluentkafka.txt @@ -1 +1 @@ -confluent-kafka==2.1.1 +confluent-kafka>=2.2.0 diff --git a/tox.ini b/tox.ini index 6e288301..243c85d9 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = {pypy3.9,3.8,3.9,3.10,3.11,3.12}-linux-integration-py-amqp {pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-redis {pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-mongodb - {3.8,3.9,3.10,3.11}-linux-integration-kafka + {3.8,3.9,3.10,3.11,3.12}-linux-integration-kafka flake8 apicheck pydocstyle @@ -29,7 +29,7 @@ deps= apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/default.txt apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test.txt apicheck,pypy3.9,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: -r{toxinidir}/requirements/extras/confluentkafka.txt + apicheck,3.8-linux,3.9-linux,3.10-linux,3.11-linux,3.12-linux: -r{toxinidir}/requirements/extras/confluentkafka.txt apicheck,linkcheck: -r{toxinidir}/requirements/docs.txt flake8,pydocstyle,mypy: -r{toxinidir}/requirements/pkgutils.txt @@ -99,7 +99,7 @@ healthcheck_start_period = 5 environment = ALLOW_ANONYMOUS_LOGIN=yes [docker:kafka] -image = bitnami/kafka:3.4.0-debian-11-r21 +image = bitnami/kafka:latest ports = 9092:9092/tcp healthcheck_cmd = /bin/bash -c 'kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092'