summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/warcio/default.nix
blob: 2a8eb458e4dbba7fbadd52d9fb65fe6c0b098838 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  httpbin,
  multidict,
  pytestCheckHook,
  requests,
  setuptools,
  six,
  wsgiprox,
  pytest-cov-stub,
}:

buildPythonPackage rec {
  pname = "warcio";
  version = "1.7.5";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "webrecorder";
    repo = "warcio";
    tag = "v${version}"; # Repo has no git tags, see https://github.com/webrecorder/warcio/issues/126
    hash = "sha256-i1bVbXf1RQoWCADFwlVEnFhb3sVZ91vijUtzVLWMc2Q=";
  };

  patches = [
    (fetchpatch {
      # Add offline mode to skip tests that require an internet connection, https://github.com/webrecorder/warcio/pull/135
      name = "add-offline-option.patch";
      url = "https://github.com/webrecorder/warcio/pull/135/commits/2546fe457c57ab0b391764a4ce419656458d9d07.patch";
      hash = "sha256-3izm9LvAeOFixiIUUqmd5flZIxH92+NxL7jeu35aObQ=";
    })
  ];

  propagatedBuildInputs = [
    six
    setuptools
  ];

  nativeCheckInputs = [
    httpbin
    multidict # Optional. Without this, one test in test/test_utils.py is skipped.
    pytestCheckHook
    requests
    wsgiprox
    pytest-cov-stub
  ];

  pytestFlags = [
    "--offline"
  ];

  disabledTestPaths = [
    "test/test_capture_http_proxy.py"
  ];

  pythonImportsCheck = [ "warcio" ];

  meta = {
    description = "Streaming WARC/ARC library for fast web archive IO";
    mainProgram = "warcio";
    homepage = "https://github.com/webrecorder/warcio";
    changelog = "https://github.com/webrecorder/warcio/blob/master/CHANGELIST.rst";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ Luflosi ];
  };
}