1{
2 lib,
3 avro,
4 buildPythonPackage,
5 fastavro,
6 fetchFromGitHub,
7 jsonschema,
8 protobuf,
9 pyflakes,
10 pyrsistent,
11 pytestCheckHook,
12 pythonOlder,
13 rdkafka,
14 requests,
15 requests-mock,
16}:
17
18buildPythonPackage rec {
19 pname = "confluent-kafka";
20 version = "2.3.0";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "confluentinc";
27 repo = "confluent-kafka-python";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-sPlLlp0niR45lQPCvVd6NPtGI1cFbmPeQpIF1RnnY0I=";
30 };
31
32 buildInputs = [ rdkafka ];
33
34 propagatedBuildInputs = [ requests ];
35
36 passthru.optional-dependencies = {
37 avro = [
38 avro
39 fastavro
40 ];
41 json = [
42 jsonschema
43 pyrsistent
44 ];
45 protobuf = [ protobuf ];
46 };
47
48 nativeCheckInputs = [
49 pyflakes
50 pytestCheckHook
51 requests-mock
52 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
53
54 pythonImportsCheck = [ "confluent_kafka" ];
55
56 disabledTestPaths = [
57 "tests/integration/"
58 "tests/test_Admin.py"
59 "tests/test_misc.py"
60 ];
61
62 meta = with lib; {
63 description = "Confluent's Apache Kafka client for Python";
64 homepage = "https://github.com/confluentinc/confluent-kafka-python";
65 changelog = "https://github.com/confluentinc/confluent-kafka-python/blob/v${version}/CHANGELOG.md";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ mlieberman85 ];
68 };
69}