From 600bec87813ed7cd0149799f2dd50c4f4eadd911 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 11 Dec 2022 11:57:43 +0100 Subject: [PATCH 1/3] python310Packages.aranet4: init at 2.1.2 --- .../python-modules/aranet4/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/aranet4/default.nix diff --git a/pkgs/development/python-modules/aranet4/default.nix b/pkgs/development/python-modules/aranet4/default.nix new file mode 100644 index 000000000000..c9cce5ff61a8 --- /dev/null +++ b/pkgs/development/python-modules/aranet4/default.nix @@ -0,0 +1,40 @@ +{ lib +, bleak +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, pythonOlder +, requests +}: + +buildPythonPackage rec { + pname = "aranet4"; + version = "2.1.2"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-nuxj/rNuwAy1DXaJs0Qrl9GffiZqFkWxT/0TYRxg92s="; + }; + + propagatedBuildInputs = [ + bleak + requests + ]; + + # https://github.com/Anrijs/Aranet4-Python/issues/31 + doCheck = false; + + pythonImportsCheck = [ + "aranet4" + ]; + + meta = with lib; { + description = "Module to interact with Aranet4 devices"; + homepage = "https://github.com/Anrijs/Aranet4-Python"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index de076425e89b..83d9708eb2de 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -546,6 +546,8 @@ self: super: with self; { arabic-reshaper = callPackage ../development/python-modules/arabic-reshaper { }; + aranet4 = callPackage ../development/python-modules/aranet4 { }; + arc4 = callPackage ../development/python-modules/arc4 { }; arcam-fmj = callPackage ../development/python-modules/arcam-fmj { }; From fc4f384532e3bcc8e119ffbc97d788386f65cc3e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 11 Dec 2022 11:58:46 +0100 Subject: [PATCH 2/3] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 0c092c442c70..202bb433cf6e 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -181,6 +181,7 @@ ]; # missing inputs: sharp_aquos_rc "aranet" = ps: with ps; [ aiohttp-cors + aranet4 bleak-retry-connector bleak bluetooth-adapters @@ -194,7 +195,7 @@ pyserial pyudev sqlalchemy - ]; # missing inputs: aranet4 + ]; "arcam_fmj" = ps: with ps; [ arcam-fmj ]; @@ -4115,6 +4116,7 @@ "application_credentials" "apprise" "aprs" + "aranet" "arcam_fmj" "aseko_pool_live" "asuswrt" From 7daf8fbabc82dcb272a757f9e9ae71fc05c1bb21 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 11 Dec 2022 17:14:30 +0100 Subject: [PATCH 3/3] python310Packages.aranet4: 2.1.2 -> 2.1.3 Diff: https://github.com/Anrijs/Aranet4-Python/compare/refs/tags/v2.1.2...v2.1.3 - enable tests --- .../python-modules/aranet4/default.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/aranet4/default.nix b/pkgs/development/python-modules/aranet4/default.nix index c9cce5ff61a8..09781342b288 100644 --- a/pkgs/development/python-modules/aranet4/default.nix +++ b/pkgs/development/python-modules/aranet4/default.nix @@ -1,7 +1,7 @@ { lib , bleak , buildPythonPackage -, fetchPypi +, fetchFromGitHub , pytestCheckHook , pythonOlder , requests @@ -9,14 +9,16 @@ buildPythonPackage rec { pname = "aranet4"; - version = "2.1.2"; + version = "2.1.3"; format = "setuptools"; disabled = pythonOlder "3.7"; - src = fetchPypi { - inherit pname version; - hash = "sha256-nuxj/rNuwAy1DXaJs0Qrl9GffiZqFkWxT/0TYRxg92s="; + src = fetchFromGitHub { + owner = "Anrijs"; + repo = "Aranet4-Python"; + rev = "refs/tags/v${version}"; + hash = "sha256-5q4eOC9iuN8pUmDsiQ7OwEXkxi4KdL+bhGVjlQlTBAg="; }; propagatedBuildInputs = [ @@ -24,8 +26,9 @@ buildPythonPackage rec { requests ]; - # https://github.com/Anrijs/Aranet4-Python/issues/31 - doCheck = false; + checkInputs = [ + pytestCheckHook + ]; pythonImportsCheck = [ "aranet4"