From 46a5513ab8b67f9fd0487e83f5c21fff10f78d72 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 3 Jun 2022 18:45:00 +0200 Subject: [PATCH 1/4] python310Packages.aioshutil: init at 1.1 --- .../python-modules/aioshutil/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/aioshutil/default.nix diff --git a/pkgs/development/python-modules/aioshutil/default.nix b/pkgs/development/python-modules/aioshutil/default.nix new file mode 100644 index 000000000000..a76bba9c0ac2 --- /dev/null +++ b/pkgs/development/python-modules/aioshutil/default.nix @@ -0,0 +1,50 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, setuptools-scm +}: + +buildPythonPackage rec { + pname = "aioshutil"; + version = "1.1"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "kumaraditya303"; + repo = pname; + rev = "v${version}"; + hash = "sha256-CQIzNu1NrGDOh2uVif/EzB5C5t/Y/h9oT56Gp6jrOPQ="; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + ]; + + checkInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace " --cov aioshutil --cov-report xml" "" + ''; + + pythonImportsCheck = [ + "aioshutil" + ]; + + meta = with lib; { + description = "Asynchronous version of function of shutil module"; + homepage = "https://github.com/kumaraditya303/aioshutil"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c2dfd23222dd..3f2c31e327e2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -403,6 +403,8 @@ in { aioshelly = callPackage ../development/python-modules/aioshelly { }; + aioshutil = callPackage ../development/python-modules/aioshutil { }; + aiosignal = callPackage ../development/python-modules/aiosignal { }; aioslimproto = callPackage ../development/python-modules/aioslimproto { }; From 12930206aba954b614ca995613a83226a150df06 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 3 Jun 2022 21:12:07 +0200 Subject: [PATCH 2/4] python310Packages.pyunifiprotect: init at 3.7.0 --- .../python-modules/pyunifiprotect/default.nix | 85 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 87 insertions(+) create mode 100644 pkgs/development/python-modules/pyunifiprotect/default.nix diff --git a/pkgs/development/python-modules/pyunifiprotect/default.nix b/pkgs/development/python-modules/pyunifiprotect/default.nix new file mode 100644 index 000000000000..be333ee9d045 --- /dev/null +++ b/pkgs/development/python-modules/pyunifiprotect/default.nix @@ -0,0 +1,85 @@ +{ lib +, aiohttp +, aioshutil +, buildPythonPackage +, fetchFromGitHub +, packaging +, pillow +, poetry-core +, pydantic +, pyjwt +, pytest-aiohttp +, pytest-asyncio +, pytest-benchmark +, pytest-timeout +, pytest-xdist +, pytestCheckHook +, python-dotenv +, pythonOlder +, pytz +, typer +}: + +buildPythonPackage rec { + pname = "pyunifiprotect"; + version = "3.7.0"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "briis"; + repo = pname; + rev = "v${version}"; + hash = "sha256-0adbUKTkbgA4pKrIVFGowD4Wf8brjfkLpfCT/+Mw6vs="; + }; + + propagatedBuildInputs = [ + aiohttp + aioshutil + packaging + pillow + pydantic + pyjwt + python-dotenv + pytz + typer + ]; + + checkInputs = [ + pytest-aiohttp + pytest-asyncio + pytest-benchmark + pytest-timeout + pytest-xdist + pytestCheckHook + ]; + + postPatch = '' + # https://github.com/briis/pyunifiprotect/pull/176 + substituteInPlace setup.cfg \ + --replace "asyncio" "aiohttp" + substituteInPlace pyproject.toml \ + --replace "--cov=pyunifiprotect --cov-append" "" + ''; + + pythonImportsCheck = [ + "pyunifiprotect" + ]; + + pytestFlagsArray = [ + "--benchmark-disable" + ]; + + disabledTests = [ + # Tests require ffprobe + "test_get_camera_video" + ]; + + meta = with lib; { + description = "Library for interacting with the Unifi Protect API"; + homepage = "https://github.com/briis/pyunifiprotect"; + 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 3f2c31e327e2..beb68e431127 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8761,6 +8761,8 @@ in { pyunifi = callPackage ../development/python-modules/pyunifi { }; + pyunifiprotect = callPackage ../development/python-modules/pyunifiprotect { }; + pyupdate = callPackage ../development/python-modules/pyupdate { }; pyupgrade = callPackage ../development/python-modules/pyupgrade { }; From 9f5c12212de93154a45ad5adf4665dbbf63e9076 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 3 Jun 2022 21:18:16 +0200 Subject: [PATCH 3/4] python310Packages.unifi-discovery: init at 1.1.3 --- .../unifi-discovery/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/unifi-discovery/default.nix diff --git a/pkgs/development/python-modules/unifi-discovery/default.nix b/pkgs/development/python-modules/unifi-discovery/default.nix new file mode 100644 index 000000000000..511fd26132b7 --- /dev/null +++ b/pkgs/development/python-modules/unifi-discovery/default.nix @@ -0,0 +1,57 @@ +{ lib +, aiohttp +, aioresponses +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pyroute2 +, pytest-asyncio +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "unifi-discovery"; + version = "1.1.3"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "bdraco"; + repo = pname; + rev = "v${version}"; + hash = "sha256-++5Rg3cCyH4h6zzEXbsQM5tRnUsnV3RCzuOctcjA/x4="; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + pyroute2 + ]; + + checkInputs = [ + aioresponses + pytest-asyncio + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace "--cov=unifi_discovery --cov-report=term-missing:skip-covered" "" + ''; + + pythonImportsCheck = [ + "unifi_discovery" + ]; + + meta = with lib; { + description = "Module to discover Unifi devices"; + homepage = "https://github.com/bdraco/unifi-discovery"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index beb68e431127..d82231d9c380 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10780,6 +10780,8 @@ in { unifi = callPackage ../development/python-modules/unifi { }; + unifi-discovery = callPackage ../development/python-modules/unifi-discovery { }; + unify = callPackage ../development/python-modules/unify { }; unifiled = callPackage ../development/python-modules/unifiled { }; From dd61f287f405507bd4051940ed9e114bb2891202 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 3 Jun 2022 21:22:16 +0200 Subject: [PATCH 4/4] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 03e0de29fee6..53f7cc265f23 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2876,7 +2876,9 @@ ]; "unifiprotect" = ps: with ps; [ aiohttp-cors - ]; # missing inputs: pyunifiprotect unifi-discovery + pyunifiprotect + unifi-discovery + ]; "universal" = ps: with ps; [ ]; "upb" = ps: with ps; [ @@ -3779,6 +3781,7 @@ "ukraine_alarm" "unifi" "unifi_direct" + "unifiprotect" "universal" "upb" "upcloud"