1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pythonOlder,
7
8 # build-system
9 setuptools,
10
11 # dependencies
12 aiohttp,
13 async-timeout,
14 defusedxml,
15 python-didl-lite,
16 voluptuous,
17
18 # tests
19 pytest-aiohttp,
20 pytest-asyncio,
21 pytestCheckHook,
22}:
23
24buildPythonPackage rec {
25 pname = "async-upnp-client";
26 version = "0.44.0";
27 pyproject = true;
28
29 disabled = pythonOlder "3.8";
30
31 src = fetchFromGitHub {
32 owner = "StevenLooman";
33 repo = "async_upnp_client";
34 tag = version;
35 hash = "sha256-xtouCq8nkvXxgZ0jX4VuTU41xxrAkXqWEpZg/vms4Zo=";
36 };
37
38 pythonRelaxDeps = [
39 "async-timeout"
40 "defusedxml"
41 ];
42
43 build-system = [ setuptools ];
44
45 dependencies = [
46 aiohttp
47 async-timeout
48 defusedxml
49 python-didl-lite
50 voluptuous
51 ];
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 pytest-aiohttp
56 pytest-asyncio
57 ];
58
59 disabledTests = [
60 # socket.gaierror: [Errno -2] Name or service not known
61 "test_async_get_local_ip"
62 "test_get_local_ip"
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 = with lib; {
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/${version}/CHANGES.rst";
76 license = licenses.asl20;
77 maintainers = with maintainers; [ hexa ];
78 mainProgram = "upnp-client";
79 };
80}