1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools-scm,
7 crc32c,
8 lz4,
9 python-snappy,
10 zstandard,
11 botocore,
12 pytest-mock,
13 pytestCheckHook,
14 xxhash,
15}:
16
17buildPythonPackage rec {
18 version = "2.2.3";
19 pname = "kafka-python-ng";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "wbarnha";
26 repo = "kafka-python-ng";
27 tag = "v${version}";
28 hash = "sha256-a2RFiBRh3S2YQBekpwEK74ow8bGlgWCGqSf2vcgYPYk=";
29 };
30
31 build-system = [ setuptools-scm ];
32
33 optional-dependencies = {
34 crc32c = [ crc32c ];
35 lz4 = [ lz4 ];
36 snappy = [ python-snappy ];
37 zstd = [ zstandard ];
38 boto = [ botocore ];
39 };
40
41 pythonImportsCheck = [ "kafka" ];
42
43 nativeCheckInputs = [
44 pytest-mock
45 pytestCheckHook
46 xxhash
47 ]
48 ++ lib.flatten (builtins.attrValues optional-dependencies);
49
50 meta = {
51 changelog = "https://github.com/wbarnha/kafka-python-ng/releases/tag/v${version}";
52 description = "Pure Python client for Apache Kafka";
53 homepage = "https://github.com/wbarnha/kafka-python-ng";
54 license = lib.licenses.asl20;
55 maintainers = with lib.maintainers; [ dotlambda ];
56 };
57}