1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 cmake,
9 pkg-config,
10 rustPlatform,
11
12 # native dependencies
13 cyrus_sasl,
14 openssl,
15 protobuf,
16
17 # dependencies
18 jsonpickle,
19 prometheus-client,
20
21 # optional dependencies
22 confluent-kafka,
23
24 # test
25 myst-docutils,
26 pytestCheckHook,
27 pytest-benchmark,
28}:
29
30buildPythonPackage rec {
31 pname = "bytewax";
32 version = "0.21.1";
33 format = "pyproject";
34
35 disabled = pythonOlder "3.7";
36
37 src = fetchFromGitHub {
38 owner = "bytewax";
39 repo = pname;
40 tag = "v${version}";
41 hash = "sha256-O5q1Jd3AMUaQwfQM249CUnkjqEkXybxtM9SOISoULZk=";
42 };
43
44 env = {
45 OPENSSL_NO_VENDOR = true;
46 };
47
48 cargoDeps = rustPlatform.fetchCargoVendor {
49 inherit pname version src;
50 hash = "sha256-TTB1//Xza47rnfvlIs9qMvwHPj/U3w2cGTmWrEokriQ=";
51 };
52
53 nativeBuildInputs = [
54 cmake
55 pkg-config
56 rustPlatform.maturinBuildHook
57 rustPlatform.cargoSetupHook
58 ];
59
60 dontUseCmakeConfigure = true;
61
62 buildInputs = [
63 openssl
64 cyrus_sasl
65 protobuf
66 ];
67
68 dependencies = [
69 jsonpickle
70 prometheus-client
71 ];
72
73 optional-dependencies = {
74 kafka = [ confluent-kafka ];
75 };
76
77 preCheck = ''
78 export PY_IGNORE_IMPORTMISMATCH=1
79 '';
80
81 nativeCheckInputs = [
82 myst-docutils
83 pytestCheckHook
84 pytest-benchmark
85 ] ++ lib.flatten (lib.attrValues optional-dependencies);
86
87 pytestFlagsArray = [
88 "--benchmark-disable"
89 "pytests"
90 ];
91
92 disabledTestPaths = [
93 # dependens on an old myst-docutils version
94 "docs"
95 ];
96
97 pythonImportsCheck = [ "bytewax" ];
98
99 meta = with lib; {
100 description = "Python Stream Processing";
101 homepage = "https://github.com/bytewax/bytewax";
102 changelog = "https://github.com/bytewax/bytewax/releases/tag/v${version}";
103 license = licenses.asl20;
104 maintainers = with maintainers; [
105 mslingsby
106 kfollesdal
107 ];
108 };
109}