Skip to content

Commit babdf32

Browse files
authored
Reverted libversion change but kept version function to use new str only return value (confluentinc#2108)
* Build experiment with tag checks skipped to validate p314 * Dropped python 3.7 as tool chain no longer supports * Fixed typo in build-wheels.sh * More build fix attempts * Fixed 3.13+ osx artifact push * Added missing version for windows and arm linux * Fixed misplaced sem ver call * Add python install for windows * Add SPECIFIC python install for windows * Updated windows tools target CIBW * Removed tag checks * Removed tag checks * Reverted libversion change but kept version function to use new str only return value * Fixed test expansion
1 parent 8c5976e commit babdf32

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/confluent_kafka/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"KafkaException",
5656
"kafkatest",
5757
"libversion",
58+
"version",
5859
"Message",
5960
"OFFSET_BEGINNING",
6061
"OFFSET_END",

src/confluent_kafka/src/confluent_kafka.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,9 @@ PyObject *set_sasl_credentials(Handle *self, PyObject *args, PyObject *kwargs) {
29352935

29362936

29372937
static PyObject *libversion (PyObject *self, PyObject *args) {
2938-
return Py_BuildValue("s", rd_kafka_version_str());
2938+
return Py_BuildValue("si",
2939+
rd_kafka_version_str(),
2940+
rd_kafka_version());
29392941
}
29402942

29412943
/**
@@ -2954,7 +2956,7 @@ static PyMethodDef cimpl_methods[] = {
29542956
"\n"
29552957
},
29562958
{"version", version, METH_NOARGS,
2957-
" Retrieve module version string and integer\n"
2959+
" Retrieve module version string\n"
29582960
"\n"
29592961
" :returns: version_string\n"
29602962
" :rtype: str\n"

tests/test_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def test_version():
1717
print('Using confluent_kafka module version %s' % confluent_kafka.version())
1818
assert len(confluent_kafka.version()) > 0
1919

20-
print('Using librdkafka version %s' % confluent_kafka.libversion())
21-
assert len(confluent_kafka.libversion()) > 0
20+
print('Using librdkafka version (%s, %i)' % confluent_kafka.libversion())
21+
assert len(confluent_kafka.libversion()[0]) > 0
2222

2323

2424
def test_error_cb():

0 commit comments

Comments
 (0)