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