summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/swh-export/default.nix
blob: bdb3b5cd7673e7e569b5da37db59dcac97b29b7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
  lib,
  buildPythonPackage,
  fetchFromGitLab,
  setuptools,
  setuptools-scm,
  boto3,
  click,
  tqdm,
  pyorc,
  plyvel,
  python,
  types-requests,
  swh-core,
  swh-journal,
  swh-model,
  swh-storage,
  pytestCheckHook,
  pytest-kafka,
  pytest-mock,
  tzdata,
  pkgs,
}:

buildPythonPackage rec {
  pname = "swh-export";
  version = "1.8.0";
  pyproject = true;

  src = fetchFromGitLab {
    domain = "gitlab.softwareheritage.org";
    group = "swh";
    owner = "devel";
    repo = "swh-export";
    tag = "v${version}";
    hash = "sha256-n97MMYn7EmTrv411YSxUD1+zfbFB8KOSns44N3NqqV8=";
  };

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    boto3
    click
    tqdm
    pyorc
    plyvel
    types-requests
    swh-core
    swh-journal
    swh-model
    swh-storage
  ];

  preCheck = ''
    # provide timezone data, works only on linux
    export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo
  '';

  pythonImportsCheck = [ "swh.export" ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-kafka
    pytest-mock
    pkgs.zstd
    pkgs.pv
  ];

  disabledTests = [
    # I don't know how to fix the following error
    # E       fixture 'kafka_server' not found
    "test_parallel_journal_processor"
    "test_parallel_journal_processor_origin"
    "test_parallel_journal_processor_origin_visit_status"
    "test_parallel_journal_processor_offsets"
    "test_parallel_journal_processor_masked"
    "test_parallel_journal_processor_masked_origin"
    "test_parallel_journal_processor_masked_origin_visit_statuses"
  ];

  meta = {
    description = "Software Heritage dataset tools";
    homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-export";
    license = lib.licenses.gpl3Only;
    maintainers = [ ];
  };
}