1{ lib
2, aiohttp
3, async-timeout
4, asyncio-dgram
5, buildPythonPackage
6, docutils
7, fetchFromGitHub
8, fetchpatch
9, poetry-core
10, pytest-aiohttp
11, pytest-asyncio
12, pytestCheckHook
13, pythonOlder
14, voluptuous
15}:
16
17buildPythonPackage rec {
18 pname = "aioguardian";
19 version = "2023.08.0";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "bachya";
26 repo = pname;
27 rev = "refs/tags/${version}";
28 hash = "sha256-/UNSAfAkOXPJQDWBZIe/AYIhx83kPCjGzZjn4oh+gfY=";
29 };
30
31 patches = [
32 # This patch removes references to setuptools and wheel that are no longer
33 # necessary and changes poetry to poetry-core, so that we don't need to add
34 # unnecessary nativeBuildInputs.
35 #
36 # https://github.com/bachya/aioguardian/pull/288
37 #
38 (fetchpatch {
39 name = "clean-up-build-dependencies.patch";
40 url = "https://github.com/bachya/aioguardian/commit/ffaad4b396645f599815010995fb71ca976e761e.patch";
41 hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
42 })
43 ];
44
45 nativeBuildInputs = [
46 poetry-core
47 ];
48
49 propagatedBuildInputs = [
50 aiohttp
51 async-timeout
52 asyncio-dgram
53 docutils
54 voluptuous
55 ];
56
57 nativeCheckInputs = [
58 asyncio-dgram
59 pytest-aiohttp
60 pytest-asyncio
61 pytestCheckHook
62 ];
63
64 disabledTestPaths = [
65 "examples/"
66 ];
67
68 pythonImportsCheck = [
69 "aioguardian"
70 ];
71
72 meta = with lib; {
73 description = " Python library to interact with Elexa Guardian devices";
74 longDescription = ''
75 aioguardian is an asyncio-focused library for interacting with the
76 Guardian line of water valves and sensors from Elexa.
77 '';
78 homepage = "https://github.com/bachya/aioguardian";
79 changelog = "https://github.com/bachya/aioguardian/releases/tag/${version}";
80 license = with licenses; [ mit ];
81 maintainers = with maintainers; [ fab ];
82 };
83}