1{
2 lib,
3 async-timeout,
4 asyncstdlib,
5 attrs,
6 buildPythonPackage,
7 defusedxml,
8 fetchFromGitHub,
9 ftfy,
10 httpx,
11 netifaces,
12 pytest-asyncio,
13 pytestCheckHook,
14 pytest-httpx,
15 pytest-timeout,
16 pythonOlder,
17 setuptools,
18}:
19
20buildPythonPackage rec {
21 pname = "denonavr";
22 version = "0.11.6";
23 pyproject = true;
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "ol-iver";
29 repo = "denonavr";
30 rev = "refs/tags/${version}";
31 hash = "sha256-VxoRK1qeGrIunsiCzeZJUHxW/sxk+PFpntInL+G/yI8=";
32 };
33
34 pythonRelaxDeps = [ "defusedxml" ];
35
36 nativeBuildInputs = [ setuptools ];
37
38 propagatedBuildInputs = [
39 asyncstdlib
40 attrs
41 defusedxml
42 ftfy
43 httpx
44 netifaces
45 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
46
47 nativeCheckInputs = [
48 pytest-asyncio
49 pytestCheckHook
50 pytest-httpx
51 pytest-timeout
52 ];
53
54 pythonImportsCheck = [ "denonavr" ];
55
56 meta = with lib; {
57 description = "Automation Library for Denon AVR receivers";
58 homepage = "https://github.com/ol-iver/denonavr";
59 changelog = "https://github.com/ol-iver/denonavr/releases/tag/${version}";
60 license = with licenses; [ mit ];
61 maintainers = with maintainers; [ colemickens ];
62 };
63}