From ddab64189776da29169fbdc30b9e6c0024ebb43b Mon Sep 17 00:00:00 2001 From: Luflosi Date: Thu, 16 Sep 2021 21:23:17 +0200 Subject: [PATCH] python3Packages.warcio: init at 1.7.4 --- .../python-modules/warcio/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/warcio/default.nix diff --git a/pkgs/development/python-modules/warcio/default.nix b/pkgs/development/python-modules/warcio/default.nix new file mode 100644 index 00000000000..ae870a37fe5 --- /dev/null +++ b/pkgs/development/python-modules/warcio/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, six +, setuptools +, pytestCheckHook +, httpbin +, requests +, wsgiprox +, multidict +}: + +buildPythonPackage rec { + pname = "warcio"; + version = "1.7.4"; + + src = fetchFromGitHub { + owner = "webrecorder"; + repo = "warcio"; + rev = "aa702cb321621b233c6e5d2a4780151282a778be"; # Repo has no git tags, see https://github.com/webrecorder/warcio/issues/126 + sha256 = "sha256-wn2rd73wRfOqHu9H0GIn76tmEsERBBCQatnk4b/JToU="; + }; + + patches = [ + (fetchpatch { + name = "add-offline-option.patch"; + url = "https://github.com/webrecorder/warcio/pull/135/commits/2546fe457c57ab0b391764a4ce419656458d9d07.patch"; + sha256 = "sha256-3izm9LvAeOFixiIUUqmd5flZIxH92+NxL7jeu35aObQ="; + }) + ]; + + propagatedBuildInputs = [ + six + setuptools + ]; + + checkInputs = [ + pytestCheckHook + httpbin + requests + wsgiprox + multidict # Optional. Without this, one test in test/test_utils.py is skipped. + ]; + + pytestFlagsArray = [ "--offline" ]; + + pythonImportsCheck = [ "warcio" ]; + + meta = with lib; { + description = "Streaming WARC/ARC library for fast web archive IO"; + homepage = "https://github.com/webrecorder/warcio"; + license = licenses.asl20; + maintainers = with maintainers; [ Luflosi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9cd3243d1a9..95937fe941e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10308,6 +10308,8 @@ in { wandb = callPackage ../development/python-modules/wandb { }; + warcio = callPackage ../development/python-modules/warcio { }; + warlock = callPackage ../development/python-modules/warlock { }; warrant = callPackage ../development/python-modules/warrant { };