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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
{ lib
, buildPythonPackage
, fetchpatch
, fetchFromGitHub
# propagates
, jinja2
, lxml
, ncclient
, netaddr
, ntc-templates
, paramiko
, pyparsing
, pyserial
, pyyaml
, scp
, six
, transitions
, yamlordereddictloader
# tests
, mock
, nose
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "junos-eznc";
version = "2.6.3";
format = "setuptools";
src = fetchFromGitHub {
owner = "Juniper";
repo = "py-junos-eznc";
rev = version;
hash = "sha256-XhQJwtS518AzSwyaWE392nfNdYe9+iYHvXxQsjJfzI8=";
};
patches = [
(fetchpatch {
# Fixes tests with lxml>=4.8.0; remove > 2.6.3
url = "https://github.com/Juniper/py-junos-eznc/commit/048f750bb7357b6f6b9db8ad64bea479298c74fb.patch";
hash = "sha256-DYVj0BNPwDSbxDrzHhaq4F4kz1bliXB6Au3I63mRauc=";
})
];
postPatch = ''
substituteInPlace requirements.txt \
--replace "ncclient==0.6.9" "ncclient"
'';
propagatedBuildInputs = [
jinja2
lxml
ncclient
netaddr
ntc-templates
paramiko
pyparsing
pyserial
pyyaml
scp
six
transitions
yamlordereddictloader
];
checkInputs = [
mock
nose
];
checkPhase = ''
nosetests -v -a unit --exclude=test_sw_put_ftp
'';
pythonImportsCheck = [ "jnpr.junos" ];
meta = with lib; {
homepage = "https://github.com/Juniper/py-junos-eznc";
description = "Junos 'EZ' automation for non-programmers";
license = licenses.asl20;
maintainers = with maintainers; [ xnaveira ];
};
}
|