2021-04-15 00:37:46 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-03-05 16:20:37 +00:00
|
|
|
, importlib-metadata
|
2021-06-04 09:07:49 +00:00
|
|
|
, mitogen
|
2022-03-05 16:20:37 +00:00
|
|
|
, pythonOlder
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2021-04-15 00:37:46 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyroute2";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "0.7.3";
|
2022-08-12 12:06:08 +00:00
|
|
|
format = "pyproject";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-cEEEDbHC0Yf7zNFRSFsSRMQddYvoIXhYR5RjcOtrtwY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
mitogen
|
2022-03-05 16:20:37 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2021-06-04 09:07:49 +00:00
|
|
|
];
|
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
# Requires root privileges, https://github.com/svinota/pyroute2/issues/778
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyroute2"
|
2022-08-12 12:06:08 +00:00
|
|
|
"pr2modules.common"
|
|
|
|
"pr2modules.config"
|
|
|
|
"pr2modules.ethtool"
|
|
|
|
"pr2modules.ipdb"
|
|
|
|
"pr2modules.ipset"
|
|
|
|
"pr2modules.ndb"
|
|
|
|
"pr2modules.nftables"
|
|
|
|
"pr2modules.nslink"
|
|
|
|
"pr2modules.protocols"
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
2021-04-15 00:37:46 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python Netlink library";
|
|
|
|
homepage = "https://github.com/svinota/pyroute2";
|
|
|
|
license = licenses.asl20;
|
2022-03-05 16:20:37 +00:00
|
|
|
maintainers = with maintainers; [ fab mic92 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|