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.38.3";
27 pyproject = true;
28
29 disabled = pythonOlder "3.8";
30
31 src = fetchFromGitHub {
32 owner = "StevenLooman";
33 repo = "async_upnp_client";
34 rev = "refs/tags/${version}";
35 hash = "sha256-RmpQOVZ/s3Zv2e+iS7LTI5Wh/g0yy0Xv0M8ppsbYZPg=";
36 };
37
38 build-system = [ setuptools ];
39
40 dependencies = [
41 aiohttp
42 async-timeout
43 defusedxml
44 python-didl-lite
45 voluptuous
46 ];
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 pytest-aiohttp
51 pytest-asyncio
52 ];
53
54 disabledTests = [
55 # socket.gaierror: [Errno -2] Name or service not known
56 "test_async_get_local_ip"
57 "test_get_local_ip"
58 ] ++ lib.optionals stdenv.isDarwin [ "test_deferred_callback_url" ];
59
60 disabledTestPaths = [
61 # Tries to bind to multicast socket and fails to find proper interface
62 "tests/test_ssdp_listener.py"
63 ];
64
65 pythonImportsCheck = [ "async_upnp_client" ];
66
67 meta = with lib; {
68 description = "Asyncio UPnP Client library for Python";
69 homepage = "https://github.com/StevenLooman/async_upnp_client";
70 changelog = "https://github.com/StevenLooman/async_upnp_client/blob/${version}/CHANGES.rst";
71 license = licenses.asl20;
72 maintainers = with maintainers; [ hexa ];
73 mainProgram = "upnp-client";
74 };
75}