1{
2 lib,
3 buildPythonPackage,
4 duckdb,
5 elastic-transport,
6 elasticsearch,
7 fastavro,
8 fetchFromGitHub,
9 httpx,
10 lz4,
11 maxminddb,
12 msgpack,
13 pytest7CheckHook,
14 pythonOlder,
15 pytz,
16 setuptools-scm,
17 setuptools,
18 zstandard,
19}:
20
21buildPythonPackage rec {
22 pname = "flow-record";
23 version = "3.19";
24 pyproject = true;
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "fox-it";
30 repo = "flow.record";
31 tag = version;
32 hash = "sha256-9slOisPr2pW18zurBoJ8AA55fGuBA4QP1tY7YSLiYEM=";
33 };
34
35 build-system = [
36 setuptools
37 setuptools-scm
38 ];
39
40 dependencies = [ msgpack ];
41
42 optional-dependencies = {
43 compression = [
44 lz4
45 zstandard
46 ];
47 duckdb = [
48 duckdb
49 pytz
50 ];
51 elastic = [ elasticsearch ];
52 geoip = [ maxminddb ];
53 avro = [ fastavro ] ++ fastavro.optional-dependencies.snappy;
54 splunk = [ httpx ];
55 };
56
57 nativeCheckInputs = [
58 elastic-transport
59 pytest7CheckHook
60 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
61
62 pythonImportsCheck = [ "flow.record" ];
63
64 disabledTestPaths = [
65 # Test requires rdump
66 "tests/test_rdump.py"
67 ];
68
69 disabledTests = [ "test_rdump_fieldtype_path_json" ];
70
71 meta = with lib; {
72 description = "Library for defining and creating structured data";
73 homepage = "https://github.com/fox-it/flow.record";
74 changelog = "https://github.com/fox-it/flow.record/releases/tag/${src.tag}";
75 license = licenses.agpl3Only;
76 maintainers = with maintainers; [ fab ];
77 };
78}