2021-04-08 16:26:57 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-05-20 23:08:51 +00:00
|
|
|
, dnspython
|
2021-04-08 16:26:57 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, ifaddr
|
|
|
|
, pyroute2
|
2021-04-15 00:37:46 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
2021-04-08 16:26:57 +00:00
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aiodiscover";
|
2021-10-07 14:46:35 +00:00
|
|
|
version = "1.4.4";
|
2021-04-08 16:26:57 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bdraco";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-10-07 14:46:35 +00:00
|
|
|
sha256 = "sha256-DobTx6oUr25J8bolo84V4yTT0b0jBsOIzPn93uAmDl0=";
|
2021-04-08 16:26:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
dnspython
|
2021-04-08 16:26:57 +00:00
|
|
|
pyroute2
|
|
|
|
ifaddr
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-06-04 09:07:49 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '"pytest-runner>=5.2",' "" \
|
|
|
|
--replace "pyroute2>=0.5.18,!=0.6.1" "pyroute2"
|
2021-04-08 16:26:57 +00:00
|
|
|
'';
|
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require access to /etc/resolv.conf
|
|
|
|
"test_async_discover_hosts"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = ["aiodiscover"];
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module to discover hosts via ARP and PTR lookup";
|
|
|
|
homepage = "https://github.com/bdraco/aiodiscover";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|