From a8ad95943cbcdc10cc3370fbdf8f846924155b1a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 4 Mar 2026 15:28:35 +0100 Subject: [PATCH] python3Packages.matter-python-client: init at 0.4.3 --- .../matter-python-client/default.nix | 69 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 71 insertions(+) create mode 100644 pkgs/development/python-modules/matter-python-client/default.nix diff --git a/pkgs/development/python-modules/matter-python-client/default.nix b/pkgs/development/python-modules/matter-python-client/default.nix new file mode 100644 index 000000000000..40993c2a7499 --- /dev/null +++ b/pkgs/development/python-modules/matter-python-client/default.nix @@ -0,0 +1,69 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + aiohttp, + orjson, + home-assistant-chip-clusters, + + # tests + pytest-asyncio, + pytest-aiohttp, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "matter-python-client"; + version = "0.4.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "matter-js"; + repo = "matterjs-server"; + tag = "v${finalAttrs.version}"; + hash = "sha256-SnOo6AQzkIqlZPTDe/dhA1EJ8oTBg37zfjiqheGYxIM="; + }; + + sourceRoot = "${finalAttrs.src.name}/python_client"; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'version = "0.0.0"' 'version = "${finalAttrs.version}"' + ''; + + build-system = [ setuptools ]; + + dependencies = [ + aiohttp + orjson + home-assistant-chip-clusters + ]; + + nativeCheckInputs = [ + pytest-asyncio + pytest-aiohttp + pytestCheckHook + ]; + + disabledTestPaths = [ + # requires npx and network access to start matterjs + "tests/test_client_integration.py" + "tests/test_integration.py" + ]; + + pythonImportsCheck = [ + "matter_server.client" + ]; + + meta = { + description = "Python Client for the OHF Matter Server"; + homepage = "https://github.com/matter-js/matterjs-server/tree/main/python_client"; + license = lib.licenses.asl20; + teams = [ lib.teams.home-assistant ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dce8d7a332b2..bb408f30b27d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9537,6 +9537,8 @@ self: super: with self; { matrix-nio = callPackage ../development/python-modules/matrix-nio { }; + matter-python-client = callPackage ../development/python-modules/matter-python-client { }; + mattermostdriver = callPackage ../development/python-modules/mattermostdriver { }; maubot = callPackage ../development/python-modules/maubot { };