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