From d6bb50060509045bc9953ec3b1984836eec1de68 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 6 May 2021 00:22:15 +0200 Subject: [PATCH 1/3] python3Packages.motioneye-client: init at 0.3.6 --- .../motioneye-client/default.nix | 52 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/python-modules/motioneye-client/default.nix diff --git a/pkgs/development/python-modules/motioneye-client/default.nix b/pkgs/development/python-modules/motioneye-client/default.nix new file mode 100644 index 000000000000..19bb9a39c29c --- /dev/null +++ b/pkgs/development/python-modules/motioneye-client/default.nix @@ -0,0 +1,52 @@ +{ lib +, aiohttp +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pytest-aiohttp +, pytest-timeout +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "motioneye-client"; + version = "0.3.6"; + format = "pyproject"; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "dermotduffy"; + repo = pname; + rev = "v${version}"; + sha256 = "0j28rn7059km7q6z1kalp0pjcrd42wcm5mnbi94j93bvfld97w70"; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + ]; + + checkInputs = [ + pytest-aiohttp + pytest-timeout + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov-report=html:htmlcov --cov-report=xml:coverage.xml --cov-report=term-missing --cov=motioneye_client --cov-fail-under=100" "" + ''; + + pythonImportsCheck = [ "motioneye_client" ]; + + meta = with lib; { + description = "Python library for motionEye"; + homepage = "https://github.com/dermotduffy/motioneye-client"; + 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 33559777930e..07f12451ccc9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4241,6 +4241,8 @@ in { mortgage = callPackage ../development/python-modules/mortgage { }; + motioneye-client = callPackage ../development/python-modules/motioneye-client { }; + moto = callPackage ../development/python-modules/moto { }; moviepy = callPackage ../development/python-modules/moviepy { }; From 4097ca34861c1ed5f081cd13753bb8a007dec764 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 6 May 2021 18:49:55 +0200 Subject: [PATCH 2/3] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 28b7aed5f397..41868a487320 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -521,7 +521,7 @@ "monoprice" = ps: with ps; [ ]; # missing inputs: pymonoprice "moon" = ps: with ps; [ ]; "motion_blinds" = ps: with ps; [ ]; # missing inputs: motionblinds - "motioneye" = ps: with ps; [ ]; # missing inputs: motioneye-client + "motioneye" = ps: with ps; [ motioneye-client ]; "mpchc" = ps: with ps; [ ]; "mpd" = ps: with ps; [ mpd2 ]; "mqtt" = ps: with ps; [ aiohttp-cors paho-mqtt ]; From c21b6891044c4fd5aada624df093c2890aa8d488 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 6 May 2021 18:56:57 +0200 Subject: [PATCH 3/3] home-assistant: enable motioneye tests --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 4df380e2b5a0..1c11629d7879 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -295,6 +295,7 @@ in with py.pkgs; buildPythonApplication rec { "mobile_app" "modbus" "moon" + "motioneye" "mqtt" "mqtt_eventstream" "mqtt_json"