Skip to content

Commit abb48bd

Browse files
committed
Fix wheel generation
1 parent 3970e96 commit abb48bd

File tree

7 files changed

+48
-25
lines changed

7 files changed

+48
-25
lines changed

tests/common/__init__.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,12 @@
1717
#
1818

1919
import os
20-
from confluent_kafka import Consumer, DeserializingConsumer
21-
from confluent_kafka.avro import AvroConsumer
20+
from confluent_kafka import Consumer
2221

2322
_GROUP_PROTOCOL_ENV = 'TEST_CONSUMER_GROUP_PROTOCOL'
2423
_TRIVUP_CLUSTER_TYPE_ENV = 'TEST_TRIVUP_CLUSTER_TYPE'
2524

2625

27-
def _update_conf_group_protocol(conf=None):
28-
if conf is not None and 'group.id' in conf and TestUtils.use_group_protocol_consumer():
29-
conf['group.protocol'] = 'consumer'
30-
31-
3226
def _trivup_cluster_type_kraft():
3327
return _TRIVUP_CLUSTER_TYPE_ENV in os.environ and os.environ[_TRIVUP_CLUSTER_TYPE_ENV] == 'kraft'
3428

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

39+
@staticmethod
40+
def update_conf_group_protocol(conf=None):
41+
if conf is not None and 'group.id' in conf and TestUtils.use_group_protocol_consumer():
42+
conf['group.protocol'] = 'consumer'
43+
4544

4645
class TestConsumer(Consumer):
4746
def __init__(self, conf=None, **kwargs):
48-
_update_conf_group_protocol(conf)
47+
TestUtils.update_conf_group_protocol(conf)
4948
super(TestConsumer, self).__init__(conf, **kwargs)
50-
51-
52-
class TestDeserializingConsumer(DeserializingConsumer):
53-
def __init__(self, conf=None, **kwargs):
54-
_update_conf_group_protocol(conf)
55-
super(TestDeserializingConsumer, self).__init__(conf, **kwargs)
56-
57-
58-
class TestAvroConsumer(AvroConsumer):
59-
def __init__(self, conf=None, **kwargs):
60-
_update_conf_group_protocol(conf)
61-
super(TestAvroConsumer, self).__init__(conf, **kwargs)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2024 Confluent Inc.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
19+
from confluent_kafka import DeserializingConsumer
20+
from confluent_kafka.avro import AvroConsumer
21+
from tests.common import TestUtils
22+
23+
24+
class TestDeserializingConsumer(DeserializingConsumer):
25+
def __init__(self, conf=None, **kwargs):
26+
TestUtils.update_conf_group_protocol(conf)
27+
super(TestDeserializingConsumer, self).__init__(conf, **kwargs)
28+
29+
30+
class TestAvroConsumer(AvroConsumer):
31+
def __init__(self, conf=None, **kwargs):
32+
TestUtils.update_conf_group_protocol(conf)
33+
super(TestAvroConsumer, self).__init__(conf, **kwargs)

tests/integration/cluster_fixture.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
from confluent_kafka.admin import AdminClient, NewTopic
2626
from confluent_kafka.schema_registry.schema_registry_client import SchemaRegistryClient
2727

28-
from tests.common import TestDeserializingConsumer, TestConsumer
28+
from tests.common import TestConsumer
29+
from tests.common.schema_registry import TestDeserializingConsumer
2930

3031

3132
class KafkaClusterFixture(object):

tests/integration/integration_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131

3232
import confluent_kafka
3333

34-
from tests.common import TestConsumer, TestAvroConsumer
34+
from tests.common import TestConsumer
35+
from tests.common.schema_registry import TestAvroConsumer
3536

3637
try:
3738
# Memory tracker

tests/test_log.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import confluent_kafka.avro
88
import confluent_kafka.admin
99

10-
from tests.common import TestConsumer, TestAvroConsumer
10+
from tests.common import TestConsumer
11+
from tests.common.schema_registry import TestAvroConsumer
1112

1213

1314
class CountingFilter(logging.Filter):

tools/wheels/build-wheels.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ echo on
1515

1616
set CIBW_BUILD=cp37-%BW_ARCH% cp38-%BW_ARCH% cp39-%BW_ARCH% cp310-%BW_ARCH% cp311-%BW_ARCH% cp312-%BW_ARCH% cp313-%BW_ARCH%
1717
set CIBW_BEFORE_BUILD=python -m pip install delvewheel==1.1.4
18-
set CIBW_TEST_REQUIRES=-r requirements/requirements-test.txt
18+
set CIBW_TEST_REQUIRES=pytest
1919
set CIBW_TEST_COMMAND=pytest {project}\tests\test_Producer.py
2020
rem set CIBW_BUILD_VERBOSITY=3
2121
set include=%cd%\%DEST%\build\native\include

tools/wheels/build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ this_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1010
# Skip PyPy, Python2, old Python3 versions, musl, and x86 builds.
1111
export CIBW_SKIP="pp* cp27-* cp35-* cp36-* *i686 *musllinux* $CIBW_SKIP"
1212
# Run a simple test suite
13-
export CIBW_TEST_REQUIRES="-r requirements/requirements-tests.txt"
13+
export CIBW_TEST_REQUIRES="pytest"
1414
export CIBW_TEST_COMMAND="pytest {project}/tests/test_Producer.py"
1515
export CIBW_MANYLINUX_X86_64_IMAGE="manylinux_2_28"
1616
export CIBW_MANYLINUX_AARCH64_IMAGE="manylinux_2_28"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy