Skip to content

Commit 2b7d35c

Browse files
authored
Add kafka 4.3 broker version and update CI tests (#3032)
1 parent 2239960 commit 2b7d35c

6 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/flakey-test-repro.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ on:
3333
kafka_version:
3434
description: "Kafka broker version"
3535
required: true
36-
default: "4.2.0"
36+
default: "4.3.0"
3737
python_version:
3838
description: "Python version"
3939
required: true

.github/workflows/python-package.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,25 @@ jobs:
3434
- "3.0.2"
3535
- "3.5.2"
3636
- "3.9.0"
37-
- "4.2.0"
37+
- "4.3.0"
3838
python:
3939
- "3.14"
4040
include:
4141
#- python: "pypy3.9"
4242
# kafka: "2.6.0"
4343
# experimental: true
4444
- python: "3.8"
45-
kafka: "4.2.0"
45+
kafka: "4.3.0"
4646
- python: "3.9"
47-
kafka: "4.2.0"
47+
kafka: "4.3.0"
4848
- python: "3.10"
49-
kafka: "4.2.0"
49+
kafka: "4.3.0"
5050
- python: "3.11"
51-
kafka: "4.2.0"
51+
kafka: "4.3.0"
5252
- python: "3.12"
53-
kafka: "4.2.0"
53+
kafka: "4.3.0"
5454
- python: "3.13"
55-
kafka: "4.2.0"
55+
kafka: "4.3.0"
5656

5757
steps:
5858
- uses: actions/checkout@v6

Makefile

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

33
SHELL = bash
44

5-
export KAFKA_VERSION ?= 4.2.0
5+
export KAFKA_VERSION ?= 4.3.0
66
DIST_BASE_URL ?= https://downloads.apache.org/kafka/
77
ARCHIVE_BASE_URL = https://archive.apache.org/dist/kafka/
88

docs/compatibility.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Compatibility
22
-------------
33

4-
.. image:: https://img.shields.io/badge/kafka-4.0--0.8-brightgreen.svg
4+
.. image:: https://img.shields.io/badge/kafka-4.3--0.8-brightgreen.svg
55
:target: https://kafka-python.readthedocs.io/compatibility.html
66
.. image:: https://img.shields.io/pypi/pyversions/kafka-python.svg
77
:target: https://pypi.python.org/pypi/kafka-python
88

9-
kafka-python is compatible with (and tested against) broker versions 4.0
9+
kafka-python is compatible with (and tested against) broker versions 4.3
1010
through 0.8.0 . kafka-python is not compatible with the 0.8.2-beta release.
1111

1212
Because the kafka server protocol is backwards compatible, kafka-python is
@@ -18,5 +18,6 @@ PRs welcome!
1818

1919
kafka-python is tested on python 3.8-3.14.
2020
python 2.7 was supported through kafka-python release 2.3.
21+
python 3 is required for kafka-python release 3.0.
2122

2223
Builds and tests via Github Actions Workflows. See https://github.com/dpkp/kafka-python/actions

kafka/protocol/broker_version_data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def infer_broker_version_from_api_versions(api_versions):
113113
test_cases = [
114114
# format (<broker version>, <needed struct>)
115115
# Make sure to update consumer_integration test check when adding newer versions.
116+
((4, 3), ApiKey.DescribeLogDirs, 5),
116117
((4, 2), ApiKey.ListOffsets, 11),
117118
((4, 1), ApiKey.Produce, 13),
118119
((4, 0), ApiKey.ListOffsets, 10),
@@ -238,4 +239,5 @@ def infer_broker_version_from_api_versions(api_versions):
238239

239240
(4, 2): {0: (0, 13), 1: (4, 18), 2: (1, 11), 3: (0, 13), 8: (2, 10), 9: (1, 10), 10: (0, 6), 11: (0, 9), 12: (0, 4), 13: (0, 5), 14: (0, 5), 15: (0, 6), 16: (0, 5), 17: (0, 1), 18: (0, 4), 19: (2, 7), 20: (1, 6), 21: (0, 2), 22: (0, 5), 23: (2, 4), 24: (0, 5), 25: (0, 4), 26: (0, 5), 27: (1, 2), 28: (0, 5), 29: (1, 3), 30: (1, 3), 31: (1, 3), 32: (1, 4), 33: (0, 2), 34: (1, 2), 35: (1, 4), 36: (0, 2), 37: (0, 3), 38: (1, 3), 39: (1, 2), 40: (1, 2), 41: (1, 3), 42: (0, 2), 43: (0, 2), 44: (0, 1), 45: (0, 1), 46: (0, 0), 47: (0, 0), 48: (0, 1), 49: (0, 1), 50: (0, 0), 51: (0, 0), 55: (0, 2), 57: (0, 2), 60: (0, 2), 61: (0, 0), 64: (0, 0), 65: (0, 0), 66: (0, 2), 68: (0, 1), 69: (0, 1), 74: (0, 1), 75: (0, 0), 76: (1, 1), 77: (1, 1), 78: (1, 2), 79: (1, 2), 80: (0, 1), 81: (0, 0), 83: (0, 0), 84: (0, 0), 85: (0, 1), 86: (0, 0), 87: (0, 1), 88: (0, 0), 89: (0, 0), 90: (0, 1), 91: (0, 0), 92: (0, 0)},
240241

242+
(4, 3): {0: (0, 13), 1: (4, 18), 2: (1, 11), 3: (0, 13), 8: (2, 10), 9: (1, 10), 10: (0, 6), 11: (0, 9), 12: (0, 4), 13: (0, 5), 14: (0, 5), 15: (0, 6), 16: (0, 5), 17: (0, 1), 18: (0, 4), 19: (2, 7), 20: (1, 6), 21: (0, 2), 22: (0, 5), 23: (2, 4), 24: (0, 5), 25: (0, 4), 26: (0, 5), 27: (1, 2), 28: (0, 5), 29: (1, 3), 30: (1, 3), 31: (1, 3), 32: (1, 4), 33: (0, 2), 34: (1, 2), 35: (1, 5), 36: (0, 2), 37: (0, 3), 38: (1, 3), 39: (1, 2), 40: (1, 2), 41: (1, 3), 42: (0, 2), 43: (0, 2), 44: (0, 1), 45: (0, 1), 46: (0, 0), 47: (0, 0), 48: (0, 1), 49: (0, 1), 50: (0, 0), 51: (0, 0), 55: (0, 2), 57: (0, 2), 60: (0, 2), 61: (0, 0), 64: (0, 0), 65: (0, 0), 66: (0, 2), 68: (0, 1), 69: (0, 1), 74: (0, 1), 75: (0, 0), 76: (1, 1), 77: (1, 1), 78: (1, 2), 79: (1, 2), 80: (0, 1), 81: (0, 0), 83: (0, 0), 84: (0, 0), 85: (0, 1), 86: (0, 0), 87: (0, 1), 88: (0, 0), 89: (0, 0), 90: (0, 1), 91: (0, 0), 92: (0, 0)},
241243
}

test/integration/test_consumer_integration.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def test_paused(kafka_consumer_factory, topic):
4848
@pytest.mark.skipif(env_kafka_version() < (0, 10), reason="Requires KAFKA_VERSION >= 0.10")
4949
def test_kafka_version_infer(kafka_consumer_factory):
5050
with kafka_consumer_factory(api_version=None) as consumer:
51-
actual = BrokerVersionData(env_kafka_version())
52-
expected = min((4, 2), actual.broker_version)
51+
expected = BrokerVersionData(env_kafka_version()).broker_version
5352
assert consumer.config['api_version'] == expected, \
5453
"Was expecting inferred broker version to be %s but was %s" % (expected, consumer.config['api_version'])
5554

0 commit comments

Comments
 (0)