1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 httpbin,
7 multidict,
8 pytestCheckHook,
9 pythonOlder,
10 requests,
11 setuptools,
12 six,
13 wsgiprox,
14 pytest-cov-stub,
15}:
16
17buildPythonPackage rec {
18 pname = "warcio";
19 version = "1.7.5";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "webrecorder";
26 repo = "warcio";
27 tag = "v${version}"; # Repo has no git tags, see https://github.com/webrecorder/warcio/issues/126
28 hash = "sha256-i1bVbXf1RQoWCADFwlVEnFhb3sVZ91vijUtzVLWMc2Q=";
29 };
30
31 patches = [
32 (fetchpatch {
33 # Add offline mode to skip tests that require an internet connection, https://github.com/webrecorder/warcio/pull/135
34 name = "add-offline-option.patch";
35 url = "https://github.com/webrecorder/warcio/pull/135/commits/2546fe457c57ab0b391764a4ce419656458d9d07.patch";
36 hash = "sha256-3izm9LvAeOFixiIUUqmd5flZIxH92+NxL7jeu35aObQ=";
37 })
38 ];
39
40 propagatedBuildInputs = [
41 six
42 setuptools
43 ];
44
45 nativeCheckInputs = [
46 httpbin
47 multidict # Optional. Without this, one test in test/test_utils.py is skipped.
48 pytestCheckHook
49 requests
50 wsgiprox
51 pytest-cov-stub
52 ];
53
54 pytestFlags = [
55 "--offline"
56 ];
57
58 disabledTestPaths = [
59 "test/test_capture_http_proxy.py"
60 ];
61
62 pythonImportsCheck = [ "warcio" ];
63
64 meta = with lib; {
65 description = "Streaming WARC/ARC library for fast web archive IO";
66 mainProgram = "warcio";
67 homepage = "https://github.com/webrecorder/warcio";
68 changelog = "https://github.com/webrecorder/warcio/blob/master/CHANGELIST.rst";
69 license = licenses.asl20;
70 maintainers = with maintainers; [ Luflosi ];
71 };
72}