From 11e83cb0ab8b07fb3b41779ca25bfb6c5989437b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 11 Jun 2024 17:58:20 +0200 Subject: [PATCH] python312Packages.uiprotect: init at 0.13 --- .../python-modules/uiprotect/default.nix | 93 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 95 insertions(+) create mode 100644 pkgs/development/python-modules/uiprotect/default.nix diff --git a/pkgs/development/python-modules/uiprotect/default.nix b/pkgs/development/python-modules/uiprotect/default.nix new file mode 100644 index 000000000000..678237b65c87 --- /dev/null +++ b/pkgs/development/python-modules/uiprotect/default.nix @@ -0,0 +1,93 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + poetry-core, + + # dependencies + aiofiles, + aiohttp, + aioshutil, + async-timeout, + dateparser, + orjson, + packaging, + pillow, + platformdirs, + pydantic, + pyjwt, + rich, + typer, + yarl, + + # tests + aiosqlite, + asttokens, + ffmpeg, + pytest-asyncio, + pytest-benchmark, + pytest-timeout, + pytest-xdist, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "uiprotect"; + version = "0.13.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "uilibs"; + repo = "uiprotect"; + rev = "v${version}"; + hash = "sha256-Laf8P77fLTTJqqUoGZUtGIVmitrXS1OQLeW8Gqu66NU="; + }; + + postPatch = '' + sed -i "/addopts =/d" pyproject.toml + ''; + + build-system = [ poetry-core ]; + + dependencies = [ + aiofiles + aiohttp + aioshutil + async-timeout + dateparser + orjson + packaging + pillow + platformdirs + pydantic + pyjwt + rich + typer + yarl + ]; + + nativeCheckInputs = [ + aiosqlite + asttokens + ffmpeg # Required for command ffprobe + pytest-asyncio + pytest-benchmark + pytest-timeout + pytest-xdist + pytestCheckHook + ]; + + pytestFlagsArray = [ "--benchmark-disable" ]; + + pythonImportsCheck = [ "uiprotect" ]; + + meta = with lib; { + description = "Python API for UniFi Protect (Unofficial"; + homepage = "https://github.com/uilibs/uiprotect"; + changelog = "https://github.com/uilibs/uiprotect/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1e5fbc7bf0f6..06051e911aef 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16476,6 +16476,8 @@ self: super: with self; { uhi = callPackage ../development/python-modules/uhi { }; + uiprotect = callPackage ../development/python-modules/uiprotect { }; + ujson = callPackage ../development/python-modules/ujson { }; ukkonen = callPackage ../development/python-modules/ukkonen { };