Skip to content

Commit

Permalink
Release v2.6.1rc2 (#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavrth authored Nov 18, 2024
1 parent a596680 commit a29ecb9
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ tmp-KafkaCluster
.venv
venv_test
venv_examples
*Zone.Identifier
2 changes: 1 addition & 1 deletion .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ execution_time_limit:
global_job_config:
env_vars:
- name: LIBRDKAFKA_VERSION
value: v2.6.0
value: v2.6.1-RC2
prologue:
commands:
- checkout
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

v2.6.1 is a maintenance release with the following fixes and enhancements:

- Migrated build system from `setup.py` to `pyproject.toml` in accordance with `PEP 517` and `PEP 518`, improving project configuration, build system requirements management, and compatibility with modern Python packaging tools like `pip` and `build`.
- Migrated build system from `setup.py` to `pyproject.toml` in accordance with `PEP 517` and `PEP 518`, improving project configuration, build system requirements management, and compatibility with modern Python packaging tools like `pip` and `build`. (#1592)
- Removed python 3.6 support. (#1592)
- Added an example for OAUTH OIDC producer with support for confluent cloud (#1769, @sarwarbhuiyan)

confluent-kafka-python is based on librdkafka v2.6.1, see the
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# built documents.
#
# The short X.Y version.
version = '2.6.0'
version = '2.6.1rc2'
# The full version, including alpha/beta/rc tags.
release = version
######################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FROM alpine:3.12

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

ENV LIBRDKAFKA_VERSION v2.6.0
ENV LIBRDKAFKA_VERSION v2.6.1-RC2
ENV KAFKACAT_VERSION master


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "confluent-kafka"
version = "2.6.0.post1.dev1"
version = "2.6.1rc2"
description = "Confluent's Python client for Apache Kafka"
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down
14 changes: 7 additions & 7 deletions src/confluent_kafka/src/confluent_kafka.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,28 @@
* 0xMMmmRRPP
* MM=major, mm=minor, RR=revision, PP=patchlevel (not used)
*/
#define CFL_VERSION 0x02060000
#define CFL_VERSION_STR "2.6.0"
#define CFL_VERSION 0x02060100
#define CFL_VERSION_STR "2.6.1rc2"

/**
* Minimum required librdkafka version. This is checked both during
* build-time (just below) and runtime (see confluent_kafka.c).
* Make sure to keep the MIN_RD_KAFKA_VERSION, MIN_VER_ERRSTR and #error
* defines and strings in sync.
*/
#define MIN_RD_KAFKA_VERSION 0x020600ff
#define MIN_RD_KAFKA_VERSION 0x020601ff

#ifdef __APPLE__
#define MIN_VER_ERRSTR "confluent-kafka-python requires librdkafka v2.6.0 or later. Install the latest version of librdkafka from Homebrew by running `brew install librdkafka` or `brew upgrade librdkafka`"
#define MIN_VER_ERRSTR "confluent-kafka-python requires librdkafka v2.6.1 or later. Install the latest version of librdkafka from Homebrew by running `brew install librdkafka` or `brew upgrade librdkafka`"
#else
#define MIN_VER_ERRSTR "confluent-kafka-python requires librdkafka v2.6.0 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
#define MIN_VER_ERRSTR "confluent-kafka-python requires librdkafka v2.6.1 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
#endif

#if RD_KAFKA_VERSION < MIN_RD_KAFKA_VERSION
#ifdef __APPLE__
#error "confluent-kafka-python requires librdkafka v2.6.0 or later. Install the latest version of librdkafka from Homebrew by running `brew install librdkafka` or `brew upgrade librdkafka`"
#error "confluent-kafka-python requires librdkafka v2.6.1 or later. Install the latest version of librdkafka from Homebrew by running `brew install librdkafka` or `brew upgrade librdkafka`"
#else
#error "confluent-kafka-python requires librdkafka v2.6.0 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
#error "confluent-kafka-python requires librdkafka v2.6.1 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
#endif
#endif

Expand Down
27 changes: 7 additions & 20 deletions tests/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,12 @@
#

import os
from confluent_kafka import Consumer, DeserializingConsumer
from confluent_kafka.avro import AvroConsumer
from confluent_kafka import Consumer

_GROUP_PROTOCOL_ENV = 'TEST_CONSUMER_GROUP_PROTOCOL'
_TRIVUP_CLUSTER_TYPE_ENV = 'TEST_TRIVUP_CLUSTER_TYPE'


def _update_conf_group_protocol(conf=None):
if conf is not None and 'group.id' in conf and TestUtils.use_group_protocol_consumer():
conf['group.protocol'] = 'consumer'


def _trivup_cluster_type_kraft():
return _TRIVUP_CLUSTER_TYPE_ENV in os.environ and os.environ[_TRIVUP_CLUSTER_TYPE_ENV] == 'kraft'

Expand All @@ -42,20 +36,13 @@ def use_kraft():
def use_group_protocol_consumer():
return _GROUP_PROTOCOL_ENV in os.environ and os.environ[_GROUP_PROTOCOL_ENV] == 'consumer'

@staticmethod
def update_conf_group_protocol(conf=None):
if conf is not None and 'group.id' in conf and TestUtils.use_group_protocol_consumer():
conf['group.protocol'] = 'consumer'


class TestConsumer(Consumer):
def __init__(self, conf=None, **kwargs):
_update_conf_group_protocol(conf)
TestUtils.update_conf_group_protocol(conf)
super(TestConsumer, self).__init__(conf, **kwargs)


class TestDeserializingConsumer(DeserializingConsumer):
def __init__(self, conf=None, **kwargs):
_update_conf_group_protocol(conf)
super(TestDeserializingConsumer, self).__init__(conf, **kwargs)


class TestAvroConsumer(AvroConsumer):
def __init__(self, conf=None, **kwargs):
_update_conf_group_protocol(conf)
super(TestAvroConsumer, self).__init__(conf, **kwargs)
33 changes: 33 additions & 0 deletions tests/common/schema_registry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2024 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from confluent_kafka import DeserializingConsumer
from confluent_kafka.avro import AvroConsumer
from tests.common import TestUtils


class TestDeserializingConsumer(DeserializingConsumer):
def __init__(self, conf=None, **kwargs):
TestUtils.update_conf_group_protocol(conf)
super(TestDeserializingConsumer, self).__init__(conf, **kwargs)


class TestAvroConsumer(AvroConsumer):
def __init__(self, conf=None, **kwargs):
TestUtils.update_conf_group_protocol(conf)
super(TestAvroConsumer, self).__init__(conf, **kwargs)
Empty file.
3 changes: 2 additions & 1 deletion tests/integration/cluster_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
from confluent_kafka.admin import AdminClient, NewTopic
from confluent_kafka.schema_registry.schema_registry_client import SchemaRegistryClient

from tests.common import TestDeserializingConsumer, TestConsumer
from tests.common import TestConsumer
from tests.common.schema_registry import TestDeserializingConsumer


class KafkaClusterFixture(object):
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

import confluent_kafka

from tests.common import TestConsumer, TestAvroConsumer
from tests.common import TestConsumer
from tests.common.schema_registry import TestAvroConsumer

try:
# Memory tracker
Expand Down
3 changes: 2 additions & 1 deletion tests/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import confluent_kafka.avro
import confluent_kafka.admin

from tests.common import TestConsumer, TestAvroConsumer
from tests.common import TestConsumer
from tests.common.schema_registry import TestAvroConsumer


class CountingFilter(logging.Filter):
Expand Down
8 changes: 5 additions & 3 deletions tools/smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ for py in 3.9 ; do
# Copy unit tests to temporary directory to avoid any conflicting __pycache__
# directories from the source tree.
testdir=$(mktemp -d /tmp/_testdirXXXXXX)
cp tests/*.py $testdir/
mkdir -p $testdir/tests
cp tests/*.py $testdir/tests/
cp -r tests/common $testdir/tests/

# Change to a neutral path where there is no confluent_kafka sub-directory
# that might interfere with module load.
pushd $testdir
pushd $testdir/tests
echo "$0: Running unit tests"
pytest

Expand Down Expand Up @@ -123,7 +125,7 @@ c = Consumer({"group.id": "test-linux", "plugin.library.paths": "monitoring-inte
all_fails="$all_fails \[py$py: $fails\]"
fi

popd # $testdir
popd # $testdir/tests
done

if [[ -z $pyvers_tested ]]; then
Expand Down

0 comments on commit a29ecb9

Please sign in to comment.