summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/netutils/default.nix
blob: 700e5b1e6247fe2c2a3d2661a455e74dff5b68bd (plain)
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,
  buildPythonPackage,
  fetchFromGitHub,
  jinja2,
  jsonschema,
  napalm,
  poetry-core,
  pytestCheckHook,
  pyyaml,
  toml,
}:

buildPythonPackage rec {
  pname = "netutils";
  version = "1.15.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "networktocode";
    repo = "netutils";
    tag = "v${version}";
    hash = "sha256-2IPmv86b2dvvUTmvSex3hTpBi3CzHJzA5qfM3E7gv08=";
  };

  build-system = [ poetry-core ];

  dependencies = [ jsonschema ];

  optional-dependencies.optionals = [
    jsonschema
    napalm
  ];

  nativeCheckInputs = [
    jinja2
    pytestCheckHook
    pyyaml
    toml
  ];

  pythonImportsCheck = [ "netutils" ];

  disabledTests = [
    # Tests require network access
    "test_is_fqdn_resolvable"
    "test_fqdn_to_ip"
    "test_tcp_ping"
    # Skip Sphinx test
    "test_sphinx_build"
    # OSError: [Errno 22] Invalid argument
    "test_compare_type5"
    "test_encrypt_type5"
    "test_compare_cisco_type5"
    "test_get_napalm_getters_napalm_installed_default"
    "test_encrypt_cisco_type5"
  ];

  meta = {
    description = "Library that is a collection of objects for common network automation tasks";
    homepage = "https://github.com/networktocode/netutils";
    changelog = "https://github.com/networktocode/netutils/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ fab ];
  };
}