From d51bf751c1dd1df76d04b2a2919ad82fc2184649 Mon Sep 17 00:00:00 2001 From: Fabian Affolter <mail@fabian-affolter.ch> Date: Fri, 10 Sep 2021 10:32:34 +0200 Subject: [PATCH] python3Packages.python-gvm: init at 21.6.0 --- .../python-modules/python-gvm/default.nix | 66 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 68 insertions(+) create mode 100644 pkgs/development/python-modules/python-gvm/default.nix diff --git a/pkgs/development/python-modules/python-gvm/default.nix b/pkgs/development/python-modules/python-gvm/default.nix new file mode 100644 index 000000000000..27b85215e655 --- /dev/null +++ b/pkgs/development/python-modules/python-gvm/default.nix @@ -0,0 +1,66 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, poetry-core +, pytestCheckHook +, pythonOlder +, paramiko +, lxml +, defusedxml +}: + +buildPythonPackage rec { + pname = "python-gvm"; + version = "21.6.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "greenbone"; + repo = pname; + rev = "v${version}"; + sha256 = "070qpj2y7834i50lhkkbv93s77j91js06zs1bpbmplppiraxqmyz"; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + paramiko + lxml + defusedxml + ]; + + checkInputs = [ + pytestCheckHook + ]; + + patches = [ + # Switch to poetry-core, https://github.com/greenbone/python-gvm/pull/552 + (fetchpatch { + name = "switch-to-poetry-core.patch"; + url = "https://github.com/greenbone/python-gvm/commit/e48afa614ba9cf69d9b22ce1a4642c625acbaa06.patch"; + sha256 = "0f5wfdymp5dcjk1xb7ynsf0g6idjg2ifwgggp4agic5nkh1k1inl"; + }) + ]; + + disabledTests = [ + # No running SSH available + "test_connect_error" + ] ++ lib.optionals stdenv.isDarwin [ + "test_feed_xml_error" + ]; + + pythonImportsCheck = [ "gvm" ]; + + meta = with lib; { + description = "Collection of APIs that help with remote controlling a Greenbone Security Manager"; + homepage = "https://github.com/greenbone/python-gvm"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 924b56765e6d..49ddc8b97850 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7133,6 +7133,8 @@ in { python-gnupg = callPackage ../development/python-modules/python-gnupg { }; + python-gvm = callPackage ../development/python-modules/python-gvm { }; + python-hosts = callPackage ../development/python-modules/python-hosts { }; python-hpilo = callPackage ../development/python-modules/python-hpilo { };