Skip to content

Commit 59db830

Browse files
committed
Merge remote-tracking branch 'origin/master' into dev_kip-932_share_consumer_poll
2 parents 1e41691 + f5f03dc commit 59db830

43 files changed

Lines changed: 4546 additions & 589 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.semaphore/semaphore.yml

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ execution_time_limit:
88
global_job_config:
99
env_vars:
1010
- name: LIBRDKAFKA_VERSION
11-
value: v2.13.2
11+
value: v2.14.0
1212
# TODO KIP-932: Remove LIBRDKAFKA_BRANCH once LIBRDKAFKA_VERSION includes share consumer support
1313
- name: LIBRDKAFKA_BRANCH
1414
value: dev_kip-932_queues-for-kafka
@@ -29,11 +29,10 @@ blocks:
2929
env_vars:
3030
- name: OS_NAME
3131
value: osx
32-
- name: ARCH
33-
value: x64
3432
jobs:
3533
- name: Build
3634
commands:
35+
- export ARCH=x64
3736
- sem-version python 3.11
3837
- pip install uv
3938
# TODO KIP-932: Add LIBRDKAFKA_BRANCH fallback for share consumer support
@@ -52,15 +51,14 @@ blocks:
5251
env_vars:
5352
- name: OS_NAME
5453
value: osx
55-
- name: ARCH
56-
value: x64
5754
- name: CIBW_SKIP
5855
value: cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*
5956
- name: CIBW_ENVIRONMENT_MACOS
6057
value: MACOSX_DEPLOYMENT_TARGET=13
6158
jobs:
6259
- name: Build
6360
commands:
61+
- export ARCH=x64
6462
- sem-version python 3.13
6563
- pip install uv
6664
# TODO KIP-932: Add LIBRDKAFKA_BRANCH fallback for share consumer support
@@ -81,11 +79,10 @@ blocks:
8179
value: osx
8280
- name: CIBW_ARCHS
8381
value: arm64
84-
- name: ARCH
85-
value: arm64
8682
jobs:
8783
- name: Build
8884
commands:
85+
- export ARCH=arm64
8986
- sem-version python 3.11
9087
- pip install uv
9188
# TODO KIP-932: Add LIBRDKAFKA_BRANCH fallback for share consumer support
@@ -106,15 +103,14 @@ blocks:
106103
value: osx
107104
- name: CIBW_ARCHS
108105
value: arm64
109-
- name: ARCH
110-
value: arm64
111106
- name: CIBW_SKIP
112107
value: cp38-* cp39-* cp310-* cp311-* cp312-*
113108
- name: CIBW_ENVIRONMENT_MACOS
114109
value: MACOSX_DEPLOYMENT_TARGET=13
115110
jobs:
116111
- name: Build
117112
commands:
113+
- export ARCH=arm64
118114
- sem-version python 3.13
119115
- pip install uv
120116
# TODO KIP-932: Add LIBRDKAFKA_BRANCH fallback for share consumer support
@@ -133,11 +129,10 @@ blocks:
133129
env_vars:
134130
- name: OS_NAME
135131
value: linux
136-
- name: ARCH
137-
value: arm64
138132
jobs:
139133
- name: Build
140134
commands:
135+
- export ARCH=arm64
141136
- sem-version python 3.13
142137
- pip install uv
143138
# TODO KIP-932: Add LIBRDKAFKA_BRANCH fallback for share consumer support
@@ -156,11 +151,10 @@ blocks:
156151
env_vars:
157152
- name: OS_NAME
158153
value: linux
159-
- name: ARCH
160-
value: x64
161154
jobs:
162155
- name: Build
163156
commands:
157+
- export ARCH=x64
164158
- sem-version python 3.11
165159
- pip install uv
166160
# TODO KIP-932: Add LIBRDKAFKA_BRANCH fallback for share consumer support
@@ -210,10 +204,9 @@ blocks:
210204
env_vars:
211205
- name: OS_NAME
212206
value: linux
213-
- name: ARCH
214-
value: x64
215207
prologue:
216208
commands:
209+
- export ARCH=x64
217210
- '[[ -z $DOCKERHUB_APIKEY ]] || docker login --username $DOCKERHUB_USER --password $DOCKERHUB_APIKEY'
218211
- sudo apt-get update -qq && sudo apt-get install -y -qq clang-format
219212
jobs:
@@ -222,7 +215,7 @@ blocks:
222215
- sem-version python 3.11
223216
- pip install uv
224217
# use a virtualenv
225-
- uv venv _venv && source _venv/bin/activate
218+
- uv venv _venv --python "$(command -v python)" && source _venv/bin/activate
226219
- chmod u+r+x tools/source-package-verification.sh
227220
- tools/source-package-verification.sh
228221
- name: Build and Tests with 'consumer' group protocol
@@ -231,7 +224,7 @@ blocks:
231224
- sem-version java 17
232225
- pip install uv
233226
# use a virtualenv
234-
- uv venv _venv && source _venv/bin/activate
227+
- uv venv _venv --python "$(command -v python)" && source _venv/bin/activate
235228
- chmod u+r+x tools/source-package-verification.sh
236229
- export TEST_CONSUMER_GROUP_PROTOCOL=consumer
237230
- tools/source-package-verification.sh
@@ -240,7 +233,7 @@ blocks:
240233
- sem-version python 3.11
241234
- pip install uv
242235
# use a virtualenv
243-
- uv venv _venv && source _venv/bin/activate
236+
- uv venv _venv --python "$(command -v python)" && source _venv/bin/activate
244237
- chmod u+r+x tools/source-package-verification.sh
245238
- export RUN_COVERAGE=true
246239
- tools/source-package-verification.sh
@@ -257,15 +250,14 @@ blocks:
257250
env_vars:
258251
- name: OS_NAME
259252
value: linux
260-
- name: ARCH
261-
value: arm64
262253
jobs:
263254
- name: Build
264255
commands:
256+
- export ARCH=arm64
265257
- sem-version python 3.11
266258
- pip install uv
267259
# use a virtualenv
268-
- uv venv _venv && source _venv/bin/activate
260+
- uv venv _venv --python "$(command -v python)" && source _venv/bin/activate
269261
- chmod u+r+x tools/source-package-verification.sh
270262
- tools/source-package-verification.sh
271263
- name: "Source package verification with Python 3 (OSX x64) +docs"
@@ -277,15 +269,14 @@ blocks:
277269
env_vars:
278270
- name: OS_NAME
279271
value: osx
280-
- name: ARCH
281-
value: x64
282272
jobs:
283273
- name: Build
284274
commands:
275+
- export ARCH=x64
285276
- sem-version python 3.11
286277
- pip install uv
287278
# use a virtualenv
288-
- uv venv _venv && source _venv/bin/activate
279+
- uv venv _venv --python "$(command -v python)" && source _venv/bin/activate
289280
- chmod u+r+x tools/source-package-verification.sh
290281
- tools/source-package-verification.sh
291282
- name: "Source package verification with Python 3 (OSX arm64) +docs"
@@ -297,15 +288,14 @@ blocks:
297288
env_vars:
298289
- name: OS_NAME
299290
value: osx
300-
- name: ARCH
301-
value: arm64
302291
jobs:
303292
- name: Build
304293
commands:
294+
- export ARCH=arm64
305295
- sem-version python 3.11
306296
- pip install uv
307297
# use a virtualenv
308-
- uv venv _venv && source _venv/bin/activate
298+
- uv venv _venv --python "$(command -v python)" && source _venv/bin/activate
309299
- chmod u+r+x tools/source-package-verification.sh
310300
- tools/source-package-verification.sh
311301
- name: "Ducktape Performance Tests (Linux x64)"
@@ -317,8 +307,6 @@ blocks:
317307
env_vars:
318308
- name: OS_NAME
319309
value: linux
320-
- name: ARCH
321-
value: x64
322310
- name: BENCHMARK_BOUNDS_CONFIG
323311
value: tests/ducktape/producer_benchmark_bounds.json
324312
- name: BENCHMARK_ENVIRONMENT
@@ -330,9 +318,10 @@ blocks:
330318
- name: Build and Tests
331319
commands:
332320
# Setup Python environment
321+
- export ARCH=x64
333322
- sem-version python 3.11
334323
- pip install uv
335-
- uv venv _venv && source _venv/bin/activate
324+
- uv venv _venv --python "$(command -v python)" && source _venv/bin/activate
336325

337326
# Install ducktape framework and additional dependencies
338327
- uv pip install ducktape psutil
@@ -427,11 +416,10 @@ blocks:
427416
env_vars:
428417
- name: OS_NAME
429418
value: linux
430-
- name: ARCH
431-
value: x64
432419
jobs:
433420
- name: Verify
434421
commands:
422+
- export ARCH=x64
435423
- sem-version python 3.9
436424
- artifact pull workflow artifacts
437425
- cd artifacts && ls *.tgz |xargs -n1 tar -xvf && cd ..
@@ -448,11 +436,10 @@ blocks:
448436
env_vars:
449437
- name: OS_NAME
450438
value: linux
451-
- name: ARCH
452-
value: arm64
453439
jobs:
454440
- name: Verify
455441
commands:
442+
- export ARCH=arm64
456443
- sem-version python 3.9
457444
- artifact pull workflow artifacts
458445
- cd artifacts && ls *.tgz |xargs -n1 tar -xvf && cd ..
@@ -470,11 +457,10 @@ blocks:
470457
env_vars:
471458
- name: OS_NAME
472459
value: osx
473-
- name: ARCH
474-
value: x64
475460
jobs:
476461
- name: Verify
477462
commands:
463+
- export ARCH=x64
478464
- checkout
479465
- sem-version python 3.11
480466
- pip install uv
@@ -503,13 +489,12 @@ blocks:
503489
env_vars:
504490
- name: OS_NAME
505491
value: osx
506-
- name: ARCH
507-
value: arm64
508492
jobs:
509493
- name: Verify
510494
commands:
511495
- checkout
512496
- sem-version python 3.11
497+
- export ARCH=arm64
513498
- pip install uv
514499
- uv pip install --system pytest
515500
- uv pip install --system -r requirements/requirements-tests-install.txt

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,30 @@
44

55
### Fixes
66

7+
- Fix URL joining in Python client (#2228)
8+
9+
10+
## v2.14.0 - 2026-04-01
11+
12+
v2.14.0 is a feature release with the following features, fixes and enhancements:
13+
14+
### Enhancements
15+
16+
- Implement async context manager protocol for AIOProducer and AIOConsumer (#2180)
17+
- Add AssociatedNameStrategy (#2194)
18+
- Add enableAt to RuleSet (#2218)
19+
20+
### Fixes
21+
722
- Ensure normalize.schemas config is passed during Protobuf ref lookup #2214
23+
- Fix type annotations for context manager hooks so that they are correct for subclasses (#2181)
24+
- Fix OAuth callback handling for Async IO clients to prevent initialization failures (#2219)
25+
26+
27+
confluent-kafka-python v2.14.0 is based on librdkafka v2.14.0, see the
28+
[librdkafka release notes](https://github.com/confluentinc/librdkafka/releases/tag/v2.14.0)
29+
for a complete list of changes, enhancements, fixes and upgrade considerations.
30+
831

932

1033
## v2.13.2 - 2026-03-02

examples/docker/Dockerfile.alpine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ FROM alpine:3.12
3030

3131
COPY . /usr/src/confluent-kafka-python
3232

33-
ENV LIBRDKAFKA_VERSION="v2.13.2"
33+
ENV LIBRDKAFKA_VERSION="v2.14.0"
3434
ENV KCAT_VERSION="master"
3535
ENV CKP_VERSION="master"
3636

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "confluent-kafka"
7-
version = "2.13.2"
7+
version = "2.14.0"
88
description = "Confluent's Python client for Apache Kafka"
99
classifiers = [
1010
"Development Status :: 5 - Production/Stable",

requirements/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
typing-extensions; python_version < "3.11"

src/confluent_kafka/admin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def _make_futures(
325325
) -> Tuple[concurrent.futures.Future, Dict[Any, concurrent.futures.Future]]:
326326
"""
327327
Create futures and a futuremap for the keys in futmap_keys,
328-
and create a request-level future to be bassed to the C API.
328+
and create a request-level future to be passed to the C API.
329329
330330
FIXME: use _make_futures_v2 with TypeError in next major release.
331331
"""
@@ -349,7 +349,7 @@ def _make_futures_v2(
349349
) -> Tuple[concurrent.futures.Future, Dict[Any, concurrent.futures.Future]]:
350350
"""
351351
Create futures and a futuremap for the keys in futmap_keys,
352-
and create a request-level future to be bassed to the C API.
352+
and create a request-level future to be passed to the C API.
353353
"""
354354
futmap = {}
355355
for key in futmap_keys:

src/confluent_kafka/aio/_AIOConsumer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
import concurrent.futures
1717
from typing import Any, Callable, Dict, Optional, Tuple
1818

19+
# FIXME: import from typing once we depend on Python >= 3.11
20+
from typing_extensions import Self
21+
1922
import confluent_kafka
2023

2124
from . import _common as _common
@@ -46,6 +49,12 @@ def __init__(
4649

4750
self._consumer: confluent_kafka.Consumer = confluent_kafka.Consumer(consumer_conf)
4851

52+
async def __aenter__(self) -> Self:
53+
return self
54+
55+
async def __aexit__(self, *_) -> None:
56+
await self.close()
57+
4958
async def _call(self, blocking_task: Callable[..., Any], *args: Any, **kwargs: Any) -> Any:
5059
return await _common.async_call(self.executor, blocking_task, *args, **kwargs)
5160

src/confluent_kafka/aio/_common.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,4 @@ def wrap_common_callbacks(loop: asyncio.AbstractEventLoop, conf: Dict[str, Any])
8383
wrap_conf_callback(loop, conf, 'error_cb')
8484
wrap_conf_callback(loop, conf, 'throttle_cb')
8585
wrap_conf_callback(loop, conf, 'stats_cb')
86-
wrap_conf_callback(loop, conf, 'oauth_cb')
8786
wrap_conf_logger(loop, conf)

src/confluent_kafka/aio/producer/_AIOProducer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
import logging
1818
from typing import Any, Callable, Dict, Optional
1919

20+
# FIXME: import from typing once we depend on Python >= 3.11
21+
from typing_extensions import Self
22+
2023
import confluent_kafka
2124

2225
from .. import _common as _common
@@ -70,6 +73,12 @@ def __init__(
7073
if buffer_timeout > 0:
7174
self._buffer_timeout_manager.start_timeout_monitoring()
7275

76+
async def __aenter__(self) -> Self:
77+
return self
78+
79+
async def __aexit__(self, *_) -> None:
80+
await self.close()
81+
7382
async def close(self) -> None:
7483
"""Close the producer and cleanup resources
7584

0 commit comments

Comments
 (0)