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.9";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-tp2C8UCwd0MX17pA9sX6HXVQmLo/PrYZmC0W51DcYxo=";
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 "pyroute2.common"
38 "pyroute2.config"
39 "pyroute2.ethtool"
40 "pyroute2.ipdb"
41 "pyroute2.ipset"
42 "pyroute2.ndb"
43 "pyroute2.nftables"
44 "pyroute2.nslink"
45 "pyroute2.protocols"
46 ];
47
48 meta = with lib; {
49 description = "Python Netlink library";
50 homepage = "https://github.com/svinota/pyroute2";
51 changelog = "https://github.com/svinota/pyroute2/blob/${version}/CHANGELOG.rst";
52 license = licenses.asl20;
53 maintainers = with maintainers; [ fab mic92 ];
54 platforms = platforms.unix;
55 };
56}