about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/python-gvm/default.nix
blob: 27b85215e655711f6b536aceb4aefc411cf39e5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 ];
  };
}