{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, # build-system poetry-core, # dependencies aiofiles, aiohttp, aioshutil, async-timeout, convertertools, dateparser, orjson, packaging, pillow, platformdirs, propcache, pydantic, pydantic-extra-types, pyjwt, rich, typer, yarl, # tests aiosqlite, asttokens, ffmpeg, pytest-asyncio, pytest-benchmark, pytest-cov-stub, pytest-timeout, pytest-xdist, pytestCheckHook, }: buildPythonPackage rec { pname = "uiprotect"; version = "7.21.1"; pyproject = true; disabled = pythonOlder "3.10"; src = fetchFromGitHub { owner = "uilibs"; repo = "uiprotect"; tag = "v${version}"; hash = "sha256-8OxEEQuCMKHTYIpa9pfgyAhgkCMy6wpvJDMcckbV8wY="; }; build-system = [ poetry-core ]; pythonRelaxDeps = [ "aiofiles" "pydantic" ]; dependencies = [ aiofiles aiohttp aioshutil async-timeout convertertools dateparser orjson packaging pillow platformdirs propcache pydantic pydantic-extra-types pyjwt rich typer yarl ]; nativeCheckInputs = [ aiosqlite asttokens ffmpeg # Required for command ffprobe pytest-asyncio pytest-benchmark pytest-cov-stub pytest-timeout pytest-xdist pytestCheckHook ]; pytestFlags = [ "--benchmark-disable" ]; disabledTests = [ # https://127.0.0.1 vs https://127.0.0.1:0 "test_base_url" "test_bootstrap" ]; disabledTestPaths = [ # hangs the test suite "tests/test_api_ws.py" ]; 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.tag}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ hexa ]; }; }