1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 ntc-templates,
6 paramiko,
7 poetry-core,
8 pyserial,
9 pythonOlder,
10 pyyaml,
11 scp,
12 setuptools,
13 textfsm,
14}:
15
16buildPythonPackage rec {
17 pname = "netmiko";
18 version = "4.4.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-Jf8SN5dqo/8srPBJSTFGOMiZIgoWdb0CnjGwfOIM47Y=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail "poetry>=1.6.1" "poetry-core" \
31 --replace-fail "poetry.masonry.api" "poetry.core.masonry.api"
32 '';
33
34 nativeBuildInputs = [ poetry-core ];
35
36 propagatedBuildInputs = [
37 ntc-templates
38 paramiko
39 pyserial
40 pyyaml
41 scp
42 setuptools
43 textfsm
44 ];
45
46 # Tests require closed-source pyats and genie packages
47 doCheck = false;
48
49 pythonImportsCheck = [ "netmiko" ];
50
51 meta = with lib; {
52 description = "Multi-vendor library to simplify Paramiko SSH connections to network devices";
53 homepage = "https://github.com/ktbyers/netmiko/";
54 changelog = "https://github.com/ktbyers/netmiko/releases/tag/v${version}";
55 license = licenses.mit;
56 maintainers = [ maintainers.astro ];
57 };
58}