1{ lib
2, buildPythonPackage
3, dnspython
4, fetchFromGitHub
5, ifaddr
6, pyroute2
7, pytest-asyncio
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "aiodiscover";
14 version = "1.4.2";
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "bdraco";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "sha256-xiIN/YLIOdPuqenyxybu0iUpYEy3MyBssXswza5InU0=";
22 };
23
24 propagatedBuildInputs = [
25 dnspython
26 pyroute2
27 ifaddr
28 ];
29
30 postPatch = ''
31 substituteInPlace setup.py --replace '"pytest-runner>=5.2",' ""
32 '';
33
34 checkInputs = [
35 pytest-asyncio
36 pytestCheckHook
37 ];
38
39 disabledTests = [
40 # Tests require access to /etc/resolv.conf
41 "test_async_discover_hosts"
42 ];
43
44 pythonImportsCheck = ["aiodiscover"];
45
46 meta = with lib; {
47 description = "Python module to discover hosts via ARP and PTR lookup";
48 homepage = "https://github.com/bdraco/aiodiscover";
49 license = with licenses; [ asl20 ];
50 maintainers = with maintainers; [ fab ];
51 };
52}