2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, httpbin
|
2024-01-02 11:29:13 +00:00
|
|
|
, multidict
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2022-02-10 20:34:41 +00:00
|
|
|
, requests
|
2024-01-02 11:29:13 +00:00
|
|
|
, setuptools
|
|
|
|
, six
|
2022-02-10 20:34:41 +00:00
|
|
|
, wsgiprox
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "warcio";
|
|
|
|
version = "1.7.4";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "webrecorder";
|
|
|
|
repo = "warcio";
|
|
|
|
rev = "aa702cb321621b233c6e5d2a4780151282a778be"; # Repo has no git tags, see https://github.com/webrecorder/warcio/issues/126
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-wn2rd73wRfOqHu9H0GIn76tmEsERBBCQatnk4b/JToU=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2024-01-02 11:29:13 +00:00
|
|
|
# Add offline mode to skip tests that require an internet connection, https://github.com/webrecorder/warcio/pull/135
|
2022-02-10 20:34:41 +00:00
|
|
|
name = "add-offline-option.patch";
|
|
|
|
url = "https://github.com/webrecorder/warcio/pull/135/commits/2546fe457c57ab0b391764a4ce419656458d9d07.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-3izm9LvAeOFixiIUUqmd5flZIxH92+NxL7jeu35aObQ=";
|
2022-02-10 20:34:41 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
httpbin
|
2024-01-02 11:29:13 +00:00
|
|
|
multidict # Optional. Without this, one test in test/test_utils.py is skipped.
|
|
|
|
pytestCheckHook
|
2022-02-10 20:34:41 +00:00
|
|
|
requests
|
|
|
|
wsgiprox
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--offline"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access, see above
|
|
|
|
"test_get_cache_to_file"
|
|
|
|
];
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"warcio"
|
|
|
|
];
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Streaming WARC/ARC library for fast web archive IO";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "warcio";
|
2022-02-10 20:34:41 +00:00
|
|
|
homepage = "https://github.com/webrecorder/warcio";
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/webrecorder/warcio/blob/master/CHANGELIST.rst";
|
2022-02-10 20:34:41 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ Luflosi ];
|
|
|
|
};
|
|
|
|
}
|