From 12930206aba954b614ca995613a83226a150df06 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 3 Jun 2022 21:12:07 +0200 Subject: [PATCH] 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 { };