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