1{ lib 2, stdenv 3, async-timeout 4, buildPythonPackage 5, fetchFromGitHub 6, ifaddr 7, pytest-asyncio 8, pythonOlder 9, pytestCheckHook 10}: 11 12buildPythonPackage rec { 13 pname = "zeroconf"; 14 version = "0.39.4"; 15 format = "setuptools"; 16 17 disabled = pythonOlder "3.7"; 18 19 src = fetchFromGitHub { 20 owner = "jstasiak"; 21 repo = "python-zeroconf"; 22 rev = "refs/tags/${version}"; 23 hash = "sha256-CUHpTtCQBuuy8E8bjxfhGOIKr9n2Gdhg/RIyv6OWGvI="; 24 }; 25 26 propagatedBuildInputs = [ 27 async-timeout 28 ifaddr 29 ]; 30 31 # OSError: [Errno 48] Address already in use 32 doCheck = !stdenv.isDarwin; 33 34 checkInputs = [ 35 pytest-asyncio 36 pytestCheckHook 37 ]; 38 39 disabledTests = [ 40 # tests that require network interaction 41 "test_close_multiple_times" 42 "test_launch_and_close" 43 "test_launch_and_close_context_manager" 44 "test_launch_and_close_v4_v6" 45 "test_launch_and_close_v6_only" 46 "test_integration_with_listener_ipv6" 47 # Starting with 0.39.0: AssertionError: assert [('add', '_ht..._tcp.local.')] 48 "test_service_browser_expire_callbacks" 49 ] ++ lib.optionals stdenv.isDarwin [ 50 "test_lots_of_names" 51 ]; 52 53 __darwinAllowLocalNetworking = true; 54 55 pythonImportsCheck = [ 56 "zeroconf" 57 "zeroconf.asyncio" 58 ]; 59 60 meta = with lib; { 61 description = "Python implementation of multicast DNS service discovery"; 62 homepage = "https://github.com/jstasiak/python-zeroconf"; 63 license = licenses.lgpl21Only; 64 maintainers = with maintainers; [ abbradar ]; 65 }; 66}