summary refs log tree commit diff
path: root/pkgs/development/python-modules/easysnmp/default.nix
blob: 11b13d8325a0ff29e60c8a352be150e69b130a8d (plain) (blame)
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
{ lib
, buildPythonPackage
, pythonAtLeast
, fetchFromGitHub
, net-snmp
, openssl
, pytest
, pytestcov
, pytest-flake8
, pytest-sugar
, termcolor
}:

buildPythonPackage rec {
  pname = "easysnmp";
  version = "0.2.5";

  # See https://github.com/kamakazikamikaze/easysnmp/issues/108
  disabled = pythonAtLeast "3.7";

  src = fetchFromGitHub {
    owner = "kamakazikamikaze";
    repo = pname;
    rev = version;
    sha256 = "1si9iyxqj6z22jzn6m93lwpinsqn20lix2py3jm3g3fmwawkd735";
  };

  checkInputs = [
    pytest
    pytestcov
    pytest-flake8
    pytest-sugar
    termcolor
  ];

  buildInputs = [
    net-snmp
    openssl
  ];

  buildPhase = ''
    python setup.py build bdist_wheel --basedir=${lib.getBin net-snmp}/bin
  '';

  # Unable to get tests to pass, even running by hand. The pytest tests have
  # become stale.
  doCheck = false;

  meta = with lib; {
    description = "A blazingly fast and Pythonic SNMP library based on the official Net-SNMP bindings";
    homepage = "https://easysnmp.readthedocs.io/en/latest/";
    license = licenses.bsd3;
    maintainers = with maintainers; [ WhittlesJr ];
  };
}