1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7
8 # build-system
9 cmake,
10 pkg-config,
11 rustPlatform,
12
13 # native dependencies
14 cyrus_sasl,
15 openssl,
16 protobuf,
17
18 # dependencies
19 jsonpickle,
20
21 # optional dependencies
22 confluent-kafka,
23
24 # test
25 myst-docutils,
26 pytestCheckHook,
27}:
28
29buildPythonPackage rec {
30 pname = "bytewax";
31 version = "0.17.2";
32 format = "pyproject";
33
34 disabled = pythonOlder "3.7";
35
36 src = fetchFromGitHub {
37 owner = "bytewax";
38 repo = pname;
39 rev = "refs/tags/v${version}";
40 hash = "sha256-BecZvBJsaTHIhJhWM9GZldSL6Irrc7fiedulTN9e76I=";
41 };
42
43 env = {
44 OPENSSL_NO_VENDOR = true;
45 };
46
47 # Remove docs tests, myst-docutils in nixpkgs is not compatible with package requirements.
48 # Package uses old version.
49 patches = [ ./remove-docs-test.patch ];
50
51 cargoDeps = rustPlatform.importCargoLock {
52 lockFile = ./Cargo.lock;
53 outputHashes = {
54 "columnation-0.1.0" = "sha256-RAyZKR+sRmeWGh7QYPZnJgX9AtWqmca85HcABEFUgX8=";
55 "timely-0.12.0" = "sha256-sZuVLBDCXurIe38m4UAjEuFeh73VQ5Jawy+sr3U/HbI=";
56 "libsqlite3-sys-0.26.0" = "sha256-WpJA+Pm5dWKcdUrP0xS5ps/oE/yAXuQvvsdyDfDet1o=";
57 };
58 };
59
60 nativeBuildInputs = [
61 cmake
62 pkg-config
63 rustPlatform.maturinBuildHook
64 rustPlatform.cargoSetupHook
65 ];
66
67 dontUseCmakeConfigure = true;
68
69 buildInputs = [
70 openssl
71 cyrus_sasl
72 protobuf
73 ];
74
75 propagatedBuildInputs = [ jsonpickle ];
76
77 optional-dependencies = {
78 kafka = [ confluent-kafka ];
79 };
80
81 preCheck = ''
82 export PY_IGNORE_IMPORTMISMATCH=1
83 '';
84
85 checkInputs = [
86 myst-docutils
87 pytestCheckHook
88 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
89
90 disabledTestPaths = [
91 # dependens on an old myst-docutils version
92 "docs"
93 ];
94
95 pythonImportsCheck = [ "bytewax" ];
96
97 meta = with lib; {
98 description = "Python Stream Processing";
99 homepage = "https://github.com/bytewax/bytewax";
100 changelog = "https://github.com/bytewax/bytewax/releases/tag/v${version}";
101 license = licenses.asl20;
102 maintainers = with maintainers; [
103 mslingsby
104 kfollesdal
105 ];
106 # mismatched type expected u8, found i8
107 broken = stdenv.hostPlatform.isAarch64;
108 };
109}