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.39.0";
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-2A46/j6DkZ7rz/B64aBAp0NvRG5TBuL4VwMVS50+fQs=";
36 };
37
38 pythonRelaxDeps = [ "defusedxml" ];
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 # socket.gaierror: [Errno -2] Name or service not known
58 "test_async_get_local_ip"
59 "test_get_local_ip"
60 ] ++ lib.optionals stdenv.isDarwin [ "test_deferred_callback_url" ];
61
62 disabledTestPaths = [
63 # Tries to bind to multicast socket and fails to find proper interface
64 "tests/test_ssdp_listener.py"
65 ];
66
67 pythonImportsCheck = [ "async_upnp_client" ];
68
69 meta = with lib; {
70 description = "Asyncio UPnP Client library for Python";
71 homepage = "https://github.com/StevenLooman/async_upnp_client";
72 changelog = "https://github.com/StevenLooman/async_upnp_client/blob/${version}/CHANGES.rst";
73 license = licenses.asl20;
74 maintainers = with maintainers; [ hexa ];
75 mainProgram = "upnp-client";
76 };
77}