1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 fetchpatch, 6 pythonOlder, 7 8 # build-system 9 setuptools, 10 cffi, 11 12 # dependencies 13 jinja2, 14 junos-eznc, 15 lxml, 16 ncclient, 17 netaddr, 18 netmiko, 19 netutils, 20 paramiko, 21 pyeapi, 22 pyyaml, 23 requests, 24 scp, 25 textfsm, 26 ttp, 27 ttp-templates, 28 typing-extensions, 29 30 # tests 31 pytestCheckHook, 32 ddt, 33 mock, 34}: 35 36buildPythonPackage rec { 37 pname = "napalm"; 38 version = "5.0.0"; 39 format = "pyproject"; 40 41 disabled = pythonOlder "3.7"; 42 43 src = fetchFromGitHub { 44 owner = "napalm-automation"; 45 repo = "napalm"; 46 tag = version; 47 hash = "sha256-Abw3h69qTFwOOFeAfivqAIWLozErJ1yZZfx7CbMy1AI="; 48 }; 49 50 patches = [ 51 (fetchpatch { 52 url = "https://github.com/napalm-automation/napalm/commit/7e509869f7cb56892380629d1cb5f99e3e2c6190.patch"; 53 hash = "sha256-vJDACa5SmSJ/rcmKEow4Prqju/jYcCrzGpTdEYsAPq0="; 54 includes = [ 55 "napalm/ios/ios.py" 56 ]; 57 }) 58 ]; 59 60 nativeBuildInputs = [ setuptools ]; 61 62 propagatedBuildInputs = [ 63 cffi 64 jinja2 65 junos-eznc 66 lxml 67 ncclient 68 netaddr 69 netmiko 70 # breaks infinite recursion 71 (netutils.override { napalm = null; }) 72 paramiko 73 pyeapi 74 pyyaml 75 requests 76 scp 77 setuptools 78 textfsm 79 ttp 80 ttp-templates 81 typing-extensions 82 ]; 83 84 nativeCheckInputs = [ 85 pytestCheckHook 86 mock 87 ddt 88 ]; 89 90 meta = with lib; { 91 description = "Network Automation and Programmability Abstraction Layer with Multivendor support"; 92 homepage = "https://github.com/napalm-automation/napalm"; 93 license = licenses.asl20; 94 }; 95}