diff --git a/pkgs/development/python-modules/aiohomeconnect/default.nix b/pkgs/development/python-modules/aiohomeconnect/default.nix new file mode 100644 index 000000000000..5fb81b688288 --- /dev/null +++ b/pkgs/development/python-modules/aiohomeconnect/default.nix @@ -0,0 +1,67 @@ +{ + lib, + authlib, + buildPythonPackage, + fastapi, + fetchFromGitHub, + httpx, + mashumaro, + poetry-core, + pytest-asyncio, + pytest-cov-stub, + pytest-httpx, + pytestCheckHook, + pythonOlder, + typer, + uvicorn, +}: + +buildPythonPackage rec { + pname = "aiohomeconnect"; + version = "0.6.0"; + pyproject = true; + + disabled = pythonOlder "3.11"; + + src = fetchFromGitHub { + owner = "MartinHjelmare"; + repo = "aiohomeconnect"; + rev = "refs/tags/v${version}"; + hash = "sha256-fPjr4LygYIfSOiVU1yD6ICKkEGJMWOTRrT6oh7DBGTI="; + }; + + pythonRelaxDeps = [ "httpx" ]; + + build-system = [ poetry-core ]; + + dependencies = [ + httpx + mashumaro + ]; + + optional-dependencies = { + cli = [ + authlib + fastapi + typer + uvicorn + ]; + }; + + nativeCheckInputs = [ + pytest-asyncio + pytest-cov-stub + pytest-httpx + pytestCheckHook + ] ++ lib.flatten (builtins.attrValues optional-dependencies); + + pythonImportsCheck = [ "aiohomeconnect" ]; + + meta = { + description = "An asyncio client for the Home Connect API"; + homepage = "https://github.com/MartinHjelmare/aiohomeconnect"; + changelog = "https://github.com/MartinHjelmare/aiohomeconnect/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fba47007f8c8..ae05608774d0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -245,6 +245,8 @@ self: super: with self; { aiohasupervisor = callPackage ../development/python-modules/aiohasupervisor { }; + aiohomeconnect = callPackage ../development/python-modules/aiohomeconnect { }; + aiohomekit = callPackage ../development/python-modules/aiohomekit { }; aiohttp = callPackage ../development/python-modules/aiohttp { };