{ lib , aiofiles , aiohttp , aioshutil , buildPythonPackage , dateparser , fetchFromGitHub , ipython , orjson , packaging , pillow , poetry-core , pydantic , pyjwt , pytest-aiohttp , pytest-asyncio , pytest-benchmark , pytest-timeout , pytest-xdist , pytestCheckHook , python-dotenv , pythonOlder , pytz , setuptools , termcolor , typer , ffmpeg }: buildPythonPackage rec { pname = "pyunifiprotect"; version = "4.3.3"; format = "pyproject"; disabled = pythonOlder "3.9"; src = fetchFromGitHub { owner = "briis"; repo = pname; rev = "refs/tags/v${version}"; hash = "sha256-77vBKca4S0XEa5O4ntuBW8uEwVig7IBH6BX3QEmvHWc="; }; postPatch = '' substituteInPlace pyproject.toml \ --replace "--cov=pyunifiprotect --cov-append" "" \ --replace "pydantic!=1.9.1" "pydantic" ''; nativeBuildInputs = [ setuptools ]; propagatedBuildInputs = [ aiofiles aiohttp aioshutil dateparser orjson packaging pillow pydantic pyjwt pytz typer ] ++ typer.optional-dependencies.all; passthru.optional-dependencies = { shell = [ ipython python-dotenv termcolor ]; }; checkInputs = [ ffmpeg # Required for command ffprobe pytest-aiohttp pytest-asyncio pytest-benchmark pytest-timeout pytest-xdist pytestCheckHook ]; pythonImportsCheck = [ "pyunifiprotect" ]; pytestFlagsArray = [ "--benchmark-disable" ]; 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 ]; }; }