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