2021-04-13 20:39:00 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-02-21 09:55:26 +00:00
|
|
|
, importlib-metadata
|
2021-05-22 23:22:44 +01:00
|
|
|
, mitogen
|
2022-02-21 09:55:26 +00:00
|
|
|
, pythonOlder
|
2022-09-14 22:36:17 +01:00
|
|
|
, setuptools
|
2021-04-13 20:39:00 +01:00
|
|
|
}:
|
2016-12-23 23:53:15 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "pyroute2";
|
2022-09-14 22:36:17 +01:00
|
|
|
version = "0.7.3";
|
2022-07-16 11:59:28 +01:00
|
|
|
format = "pyproject";
|
2022-02-21 09:55:26 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2016-12-23 23:53:15 +00:00
|
|
|
|
2018-06-23 14:27:58 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-14 22:36:17 +01:00
|
|
|
hash = "sha256-cEEEDbHC0Yf7zNFRSFsSRMQddYvoIXhYR5RjcOtrtwY=";
|
2016-12-23 23:53:15 +00:00
|
|
|
};
|
|
|
|
|
2022-09-14 22:36:17 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-05-22 23:22:44 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
mitogen
|
2022-02-21 09:55:26 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2021-05-22 23:22:44 +01:00
|
|
|
];
|
|
|
|
|
2021-04-13 20:39:00 +01:00
|
|
|
# Requires root privileges, https://github.com/svinota/pyroute2/issues/778
|
2016-12-23 23:53:15 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-02-21 09:55:26 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyroute2"
|
2022-07-16 11:59:28 +01:00
|
|
|
"pr2modules.common"
|
|
|
|
"pr2modules.config"
|
|
|
|
"pr2modules.ethtool"
|
|
|
|
"pr2modules.ipdb"
|
|
|
|
"pr2modules.ipset"
|
|
|
|
"pr2modules.ndb"
|
|
|
|
"pr2modules.nftables"
|
|
|
|
"pr2modules.nslink"
|
|
|
|
"pr2modules.protocols"
|
2022-02-21 09:55:26 +00:00
|
|
|
];
|
2021-04-13 20:39:00 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-12-23 23:53:15 +00:00
|
|
|
description = "Python Netlink library";
|
2020-03-25 14:52:22 +00:00
|
|
|
homepage = "https://github.com/svinota/pyroute2";
|
2016-12-23 23:53:15 +00:00
|
|
|
license = licenses.asl20;
|
2022-02-21 09:55:26 +00:00
|
|
|
maintainers = with maintainers; [ fab mic92 ];
|
2019-02-17 13:00:33 +00:00
|
|
|
platforms = platforms.unix;
|
2016-12-23 23:53:15 +00:00
|
|
|
};
|
|
|
|
}
|