1{
2 lib,
3 authlib,
4 buildPythonPackage,
5 fastapi,
6 fetchFromGitHub,
7 httpx,
8 httpx-sse,
9 mashumaro,
10 poetry-core,
11 pytest-asyncio,
12 pytest-cov-stub,
13 pytest-httpx,
14 pytestCheckHook,
15 pythonOlder,
16 typer,
17 uvicorn,
18}:
19
20buildPythonPackage rec {
21 pname = "aiohomeconnect";
22 version = "0.7.2";
23 pyproject = true;
24
25 disabled = pythonOlder "3.11";
26
27 src = fetchFromGitHub {
28 owner = "MartinHjelmare";
29 repo = "aiohomeconnect";
30 rev = "refs/tags/v${version}";
31 hash = "sha256-E+2IQy3O+ccvZfjlORo+eTd+l41FSXk1dIE2Adrn3Ok=";
32 };
33
34 pythonRelaxDeps = [ "httpx" ];
35
36 build-system = [ poetry-core ];
37
38 dependencies = [
39 httpx
40 httpx-sse
41 mashumaro
42 ];
43
44 optional-dependencies = {
45 cli = [
46 authlib
47 fastapi
48 typer
49 uvicorn
50 ];
51 };
52
53 nativeCheckInputs = [
54 pytest-asyncio
55 pytest-cov-stub
56 pytest-httpx
57 pytestCheckHook
58 ] ++ lib.flatten (builtins.attrValues optional-dependencies);
59
60 pythonImportsCheck = [ "aiohomeconnect" ];
61
62 meta = {
63 description = "An asyncio client for the Home Connect API";
64 homepage = "https://github.com/MartinHjelmare/aiohomeconnect";
65 changelog = "https://github.com/MartinHjelmare/aiohomeconnect/blob/${src.rev}/CHANGELOG.md";
66 license = lib.licenses.asl20;
67 maintainers = with lib.maintainers; [ fab ];
68 };
69}