2022-06-16 17:23:12 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch, setuptools, cffi
|
2022-02-21 08:47:16 +00:00
|
|
|
, paramiko, requests, future, textfsm, jinja2, netaddr, pyyaml, pyeapi, netmiko
|
2022-05-18 14:49:53 +00:00
|
|
|
, junos-eznc, ciscoconfparse, scp, lxml, ncclient, pytestCheckHook, ddt, mock
|
2022-06-26 10:26:21 +00:00
|
|
|
, pythonOlder, invoke }:
|
2022-02-21 08:47:16 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "napalm";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "3.4.1";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2022-02-21 08:47:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "napalm-automation";
|
|
|
|
repo = "napalm";
|
|
|
|
rev = version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-TNWRJtc6+VS6wgJGGvCPDoFQmOKQAyXdjFQo9bPJ2F8=";
|
2022-02-21 08:47:16 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# netmiko 4.0.0 support
|
|
|
|
(fetchpatch{
|
|
|
|
url = "https://github.com/napalm-automation/napalm/commit/4b8cc85db3236099a04f742cf71773e74d9dd70e.patch";
|
|
|
|
excludes = [ "requirements.txt" ];
|
|
|
|
sha256 = "sha256-DBKp+wiKd+/j2xAqaQL3UCcGQd6wnWcNTsNXBBt9c98=";
|
|
|
|
})
|
|
|
|
(fetchpatch{
|
|
|
|
url = "https://github.com/napalm-automation/napalm/commit/4a8b5b1823335dd79aa5269c038a1f08ecd35cdd.patch";
|
|
|
|
sha256 = "sha256-uiou/rzmnFf4wAvXwmUsGJx99GeHWKJB2JrMM1kLakM=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "netmiko>=3.3.0,<4.0.0" "netmiko"
|
|
|
|
'';
|
|
|
|
|
2022-02-21 08:47:16 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cffi
|
|
|
|
paramiko
|
|
|
|
requests
|
|
|
|
future
|
|
|
|
textfsm
|
2022-06-26 10:26:21 +00:00
|
|
|
invoke
|
2022-02-21 08:47:16 +00:00
|
|
|
jinja2
|
|
|
|
netaddr
|
|
|
|
pyyaml
|
|
|
|
pyeapi
|
|
|
|
netmiko
|
|
|
|
junos-eznc
|
|
|
|
ciscoconfparse
|
|
|
|
scp
|
2022-06-26 10:26:21 +00:00
|
|
|
setuptools
|
2022-02-21 08:47:16 +00:00
|
|
|
lxml
|
|
|
|
ncclient
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook mock ddt ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description =
|
|
|
|
"Network Automation and Programmability Abstraction Layer with Multivendor support";
|
|
|
|
homepage = "https://github.com/napalm-automation/napalm";
|
|
|
|
license = licenses.asl20;
|
2022-06-26 10:26:21 +00:00
|
|
|
maintainers = with maintainers; [ ] ++ teams.c3d2.members;
|
2022-02-21 08:47:16 +00:00
|
|
|
};
|
|
|
|
}
|