1{
2 lib,
3 aiodns,
4 async-timeout,
5 buildPythonPackage,
6 cached-ipaddress,
7 dnspython,
8 fetchFromGitHub,
9 ifaddr,
10 netifaces,
11 poetry-core,
12 pyroute2,
13 pytest-asyncio,
14 pytest-cov-stub,
15 pytestCheckHook,
16 pythonOlder,
17}:
18
19buildPythonPackage rec {
20 pname = "aiodiscover";
21 version = "2.7.1";
22 pyproject = true;
23
24 disabled = pythonOlder "3.9";
25
26 src = fetchFromGitHub {
27 owner = "bdraco";
28 repo = "aiodiscover";
29 tag = "v${version}";
30 hash = "sha256-q0HXANSfoDPlGdokfiQcsMHkt9ZmD604JRL/SDQx2hw=";
31 };
32
33 build-system = [ poetry-core ];
34
35 dependencies = [
36 async-timeout
37 aiodns
38 cached-ipaddress
39 dnspython
40 ifaddr
41 netifaces
42 pyroute2
43 ];
44
45 nativeCheckInputs = [
46 pytest-asyncio
47 pytest-cov-stub
48 pytestCheckHook
49 ];
50
51 disabledTests = [
52 # Tests require access to /etc/resolv.conf
53 "test_async_discover_hosts"
54 ];
55
56 pythonImportsCheck = [ "aiodiscover" ];
57
58 meta = with lib; {
59 description = "Python module to discover hosts via ARP and PTR lookup";
60 homepage = "https://github.com/bdraco/aiodiscover";
61 changelog = "https://github.com/bdraco/aiodiscover/releases/tag/${src.tag}";
62 license = with licenses; [ asl20 ];
63 maintainers = with maintainers; [ fab ];
64 };
65}