Skip to content

V1.1.0rc #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
environment:
global:
LIBRDKAFKA_NUGET_VERSION: 1.0.1
LIBRDKAFKA_NUGET_VERSION: 1.1.0
CIBW_SKIP: cp33-* cp34-*
CIBW_TEST_REQUIRES: pytest requests avro
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
env:
global:
- LIBRDKAFKA_VERSION=v1.0.1
- LIBRDKAFKA_VERSION=v1.1.0
matrix:
include:
# Source package verification with Python 2.7
Expand Down
2 changes: 1 addition & 1 deletion confluent_kafka/src/confluent_kafka.c
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,7 @@ static PyObject *libversion (PyObject *self, PyObject *args) {
* MM=major, mm=minor, RR=revision, PP=patchlevel (not used)
*/
static PyObject *version (PyObject *self, PyObject *args) {
return Py_BuildValue("si", "1.0.1", 0x01000100);
return Py_BuildValue("si", "1.1.0", 0x01010000);
}

static PyMethodDef cimpl_methods[] = {
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# built documents.
#
# The short X.Y version.
version = '1.0.1'
version = '1.1.0'
# The full version, including alpha/beta/rc tags.
release = '1.0.1'
release = '1.1.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_install_requirements(path):


setup(name='confluent-kafka',
version='1.0.1',
version='1.1.0',
description='Confluent\'s Python client for Apache Kafka',
author='Confluent Inc',
author_email='support@confluent.io',
Expand Down
4 changes: 2 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest
flake8
pytest==4.6.4
flake8
32 changes: 16 additions & 16 deletions tests/test_Consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_multiple_close_throw_exception():

with pytest.raises(RuntimeError) as ex:
c.close()
assert 'Consumer already closed' == str(ex.value)
assert ex.match('Consumer already closed')


def test_any_method_after_close_throws_exception():
Expand All @@ -244,51 +244,51 @@ def test_any_method_after_close_throws_exception():

with pytest.raises(RuntimeError) as ex:
c.subscribe(['test'])
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.unsubscribe()
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.poll()
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.consume()
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.assign([TopicPartition('test', 0)])
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.unassign()
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.assignment()
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.commit()
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.committed([TopicPartition("test", 0)])
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.position([TopicPartition("test", 0)])
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.seek([TopicPartition("test", 0, 0)])
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
lo, hi = c.get_watermark_offsets(TopicPartition("test", 0))
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')


@pytest.mark.skipif(libversion()[1] < 0x000b0000,
Expand All @@ -308,16 +308,16 @@ def test_calling_store_offsets_after_close_throws_erro():

with pytest.raises(RuntimeError) as ex:
c.store_offsets(offsets=[TopicPartition("test", 0, 42)])
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')

with pytest.raises(RuntimeError) as ex:
c.offsets_for_times([TopicPartition("test", 0)])
assert 'Consumer closed' == str(ex.value)
assert ex.match('Consumer closed')


def test_consumer_withot_groupid():
""" Consumer should raise exception if group.id is not set """

with pytest.raises(ValueError) as ex:
Consumer({'bootstrap.servers': "mybroker:9092"})
assert 'group.id must be set' in str(ex)
assert ex.match('group.id must be set')
8 changes: 4 additions & 4 deletions tests/test_Producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def test_produce_headers_should_fail():
'error_cb': error_cb,
'message.timeout.ms': 10})

with pytest.raises(NotImplementedError) as e:
with pytest.raises(NotImplementedError) as ex:
p.produce('mytopic', value='somedata', key='a key', headers=[('headerkey', 'headervalue')])
assert 'Producer message headers requires confluent-kafka-python built for librdkafka version >=v0.11.4' in str(e)
assert ex.match('Producer message headers requires confluent-kafka-python built for librdkafka version >=v0.11.4')


def test_subclassing():
Expand Down Expand Up @@ -188,6 +188,6 @@ def test_set_invalid_partitioner_murmur():
"""
Assert invalid partitioner raises KafkaException
"""
with pytest.raises(KafkaException) as e:
with pytest.raises(KafkaException) as ex:
Producer({'partitioner': 'murmur'})
assert 'Invalid value for configuration property "partitioner": murmur' in str(e)
assert ex.match('Invalid value for configuration property "partitioner": murmur')
6 changes: 4 additions & 2 deletions tools/fixup-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ fixup_wheel_macosx () {

# Change the name to be local
install_name_tool -id "$lib" $lib
if otool -L $lib | grep -q /usr/local/lib/librdkafka.1.dylib ; then
# Extract existing(old) reference
old=$(otool -L $lib | grep -o '.*librdkafka.1.dylib' | xargs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Nice trick, but will not handle multiple spaces in the path itself (however unlikely).

$ echo '  y/    strange path/x' | xargs
y/ strange path/x

That's ok for now though.,

if [[ ! -z "$old" ]]; then
# Change the librdkafka reference to load from the same
# directory as the plugin
install_name_tool -change /usr/local/lib/librdkafka.1.dylib '@loader_path/librdkafka.1.dylib' $lib
install_name_tool -change "$old" '@loader_path/librdkafka.1.dylib' $lib
otool -L $lib
else
echo "WARNING: couldn't find librdkafka reference in $lib"
Expand Down
4 changes: 2 additions & 2 deletions tools/install-interceptors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ set -e
pkgtype=$1

# Confluent Platform release version
CPVER=5.0
CPVER=5.2

# confluent-librdkafka-plugins version
PLUGINVER=0.11.0
PLUGINVER=0.11.1

# Stage directory for wheels
stagedir=staging/libs
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ commands =

[base]
deps =
pytest
# https://docs.pytest.org/en/latest/changelog.html#id53
pytest==4.6.4
pytest-timeout
fastavro
requests
Expand Down