1{ lib
2, buildPythonPackage
3, fetchPypi
4, importlib-metadata
5, mitogen
6, pythonOlder
7, setuptools
8}:
9
10buildPythonPackage rec {
11 pname = "pyroute2";
12 version = "0.7.3";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-cEEEDbHC0Yf7zNFRSFsSRMQddYvoIXhYR5RjcOtrtwY=";
20 };
21
22 nativeBuildInputs = [
23 setuptools
24 ];
25
26 propagatedBuildInputs = [
27 mitogen
28 ] ++ lib.optionals (pythonOlder "3.8") [
29 importlib-metadata
30 ];
31
32 # Requires root privileges, https://github.com/svinota/pyroute2/issues/778
33 doCheck = false;
34
35 pythonImportsCheck = [
36 "pyroute2"
37 "pr2modules.common"
38 "pr2modules.config"
39 "pr2modules.ethtool"
40 "pr2modules.ipdb"
41 "pr2modules.ipset"
42 "pr2modules.ndb"
43 "pr2modules.nftables"
44 "pr2modules.nslink"
45 "pr2modules.protocols"
46 ];
47
48 meta = with lib; {
49 description = "Python Netlink library";
50 homepage = "https://github.com/svinota/pyroute2";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ fab mic92 ];
53 platforms = platforms.unix;
54 };
55}