1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, jinja2
6, lxml
7, mock
8, ncclient
9, netaddr
10, nose
11, ntc-templates
12, paramiko
13, pyparsing
14, pyserial
15, pythonOlder
16, pyyaml
17, scp
18, six
19, transitions
20, yamlordereddictloader
21}:
22
23buildPythonPackage rec {
24 pname = "junos-eznc";
25 version = "2.6.7";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchFromGitHub {
31 owner = "Juniper";
32 repo = "py-junos-eznc";
33 rev = "refs/tags/${version}";
34 hash = "sha256-+hGybznip5RpJm89MLg9JO4B/y50OIdgtmV2FIpZShU=";
35 };
36
37 postPatch = ''
38 # https://github.com/Juniper/py-junos-eznc/issues/1236
39 substituteInPlace lib/jnpr/junos/utils/scp.py \
40 --replace "inspect.getargspec" "inspect.getfullargspec"
41 '';
42
43 propagatedBuildInputs = [
44 jinja2
45 lxml
46 ncclient
47 netaddr
48 ntc-templates
49 paramiko
50 pyparsing
51 pyserial
52 pyyaml
53 scp
54 six
55 transitions
56 yamlordereddictloader
57 ];
58
59 nativeCheckInputs = [
60 mock
61 nose
62 ];
63
64 checkPhase = ''
65 nosetests -v -a unit --exclude=test_sw_put_ftp
66 '';
67
68 pythonImportsCheck = [
69 "jnpr.junos"
70 ];
71
72 meta = with lib; {
73 changelog = "https://github.com/Juniper/py-junos-eznc/releases/tag/${version}";
74 description = "Junos 'EZ' automation for non-programmers";
75 homepage = "https://github.com/Juniper/py-junos-eznc";
76 license = licenses.asl20;
77 maintainers = with maintainers; [ xnaveira ];
78 };
79}