1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # build-system 8 setuptools, 9 10 # dependencies 11 aiohttp, 12 async-timeout, 13 defusedxml, 14 python-didl-lite, 15 voluptuous, 16 17 # tests 18 pytest-aiohttp, 19 pytest-asyncio, 20 pytestCheckHook, 21}: 22 23buildPythonPackage rec { 24 pname = "async-upnp-client"; 25 version = "0.45.0"; 26 pyproject = true; 27 28 src = fetchFromGitHub { 29 owner = "StevenLooman"; 30 repo = "async_upnp_client"; 31 tag = version; 32 hash = "sha256-bRUEnedPDFBgpJeDPRG6e6fQUJ/R2RaasVKHZX7COp8="; 33 }; 34 35 pythonRelaxDeps = [ 36 "async-timeout" 37 "defusedxml" 38 ]; 39 40 build-system = [ setuptools ]; 41 42 dependencies = [ 43 aiohttp 44 async-timeout 45 defusedxml 46 python-didl-lite 47 voluptuous 48 ]; 49 50 nativeCheckInputs = [ 51 pytestCheckHook 52 pytest-aiohttp 53 pytest-asyncio 54 ]; 55 56 disabledTests = [ 57 "test_decode_ssdp_packet" 58 "test_microsoft_butchers_ssdp" 59 # socket.gaierror: [Errno -2] Name or service not known 60 "test_async_get_local_ip" 61 "test_get_local_ip" 62 ] 63 ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_deferred_callback_url" ]; 64 65 disabledTestPaths = [ 66 # Tries to bind to multicast socket and fails to find proper interface 67 "tests/test_ssdp_listener.py" 68 ]; 69 70 pythonImportsCheck = [ "async_upnp_client" ]; 71 72 meta = { 73 description = "Asyncio UPnP Client library for Python"; 74 homepage = "https://github.com/StevenLooman/async_upnp_client"; 75 changelog = "https://github.com/StevenLooman/async_upnp_client/blob/${src.tag}/CHANGES.rst"; 76 license = lib.licenses.asl20; 77 maintainers = with lib.maintainers; [ hexa ]; 78 mainProgram = "upnp-client"; 79 }; 80}