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}:
15
16buildPythonPackage rec {
17 pname = "warcio";
18 version = "1.7.4";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "webrecorder";
25 repo = "warcio";
26 rev = "aa702cb321621b233c6e5d2a4780151282a778be"; # Repo has no git tags, see https://github.com/webrecorder/warcio/issues/126
27 hash = "sha256-wn2rd73wRfOqHu9H0GIn76tmEsERBBCQatnk4b/JToU=";
28 };
29
30 patches = [
31 (fetchpatch {
32 # Add offline mode to skip tests that require an internet connection, https://github.com/webrecorder/warcio/pull/135
33 name = "add-offline-option.patch";
34 url = "https://github.com/webrecorder/warcio/pull/135/commits/2546fe457c57ab0b391764a4ce419656458d9d07.patch";
35 hash = "sha256-3izm9LvAeOFixiIUUqmd5flZIxH92+NxL7jeu35aObQ=";
36 })
37 ];
38
39 propagatedBuildInputs = [
40 six
41 setuptools
42 ];
43
44 nativeCheckInputs = [
45 httpbin
46 multidict # Optional. Without this, one test in test/test_utils.py is skipped.
47 pytestCheckHook
48 requests
49 wsgiprox
50 ];
51
52 pytestFlagsArray = [ "--offline" ];
53
54 disabledTests = [
55 # Tests require network access, see above
56 "test_get_cache_to_file"
57 ];
58
59 pythonImportsCheck = [ "warcio" ];
60
61 meta = with lib; {
62 description = "Streaming WARC/ARC library for fast web archive IO";
63 mainProgram = "warcio";
64 homepage = "https://github.com/webrecorder/warcio";
65 changelog = "https://github.com/webrecorder/warcio/blob/master/CHANGELIST.rst";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ Luflosi ];
68 };
69}