summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyroute2/default.nix
blob: b232a0bd8f41881a0bc5c6ec2e7827630cae317c (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
, fetchPypi
, importlib-metadata
, mitogen
, pythonOlder
, setuptools
}:

buildPythonPackage rec {
  pname = "pyroute2";
  version = "0.7.4";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-d1rO/vTSrOdZHmIAAL3zg8cMi3lpgEhw9sLYIE+iF+A=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    mitogen
  ] ++ lib.optionals (pythonOlder "3.8") [
    importlib-metadata
  ];

  # Requires root privileges, https://github.com/svinota/pyroute2/issues/778
  doCheck = false;

  pythonImportsCheck = [
    "pyroute2"
    "pr2modules.common"
    "pr2modules.config"
    "pr2modules.ethtool"
    "pr2modules.ipdb"
    "pr2modules.ipset"
    "pr2modules.ndb"
    "pr2modules.nftables"
    "pr2modules.nslink"
    "pr2modules.protocols"
  ];

  meta = with lib; {
    description = "Python Netlink library";
    homepage = "https://github.com/svinota/pyroute2";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab mic92 ];
    platforms = platforms.unix;
  };
}