1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitLab,
5 setuptools,
6 setuptools-scm,
7 boto3,
8 click,
9 tqdm,
10 pyorc,
11 plyvel,
12 python,
13 types-requests,
14 swh-core,
15 swh-journal,
16 swh-model,
17 swh-storage,
18 pytestCheckHook,
19 pytest-kafka,
20 pytest-mock,
21 tzdata,
22 pkgs,
23}:
24
25buildPythonPackage rec {
26 pname = "swh-export";
27 version = "1.8.0";
28 pyproject = true;
29
30 src = fetchFromGitLab {
31 domain = "gitlab.softwareheritage.org";
32 group = "swh";
33 owner = "devel";
34 repo = "swh-export";
35 tag = "v${version}";
36 hash = "sha256-n97MMYn7EmTrv411YSxUD1+zfbFB8KOSns44N3NqqV8=";
37 };
38
39 build-system = [
40 setuptools
41 setuptools-scm
42 ];
43
44 dependencies = [
45 boto3
46 click
47 tqdm
48 pyorc
49 plyvel
50 types-requests
51 swh-core
52 swh-journal
53 swh-model
54 swh-storage
55 ];
56
57 preCheck = ''
58 # provide timezone data, works only on linux
59 export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
60 '';
61
62 pythonImportsCheck = [ "swh.export" ];
63
64 nativeCheckInputs = [
65 pytestCheckHook
66 pytest-kafka
67 pytest-mock
68 pkgs.zstd
69 pkgs.pv
70 ];
71
72 disabledTests = [
73 # I don't know how to fix the following error
74 # E fixture 'kafka_server' not found
75 "test_parallel_journal_processor"
76 "test_parallel_journal_processor_origin"
77 "test_parallel_journal_processor_origin_visit_status"
78 "test_parallel_journal_processor_offsets"
79 "test_parallel_journal_processor_masked"
80 "test_parallel_journal_processor_masked_origin"
81 "test_parallel_journal_processor_masked_origin_visit_statuses"
82 ];
83
84 meta = {
85 description = "Software Heritage dataset tools";
86 homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-export";
87 license = lib.licenses.gpl3Only;
88 maintainers = with lib.maintainers; [ ];
89 };
90}