94427deb9d
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
106 lines
1.8 KiB
Nix
106 lines
1.8 KiB
Nix
{ lib
|
|
, aiofiles
|
|
, aiohttp
|
|
, aioshutil
|
|
, buildPythonPackage
|
|
, dateparser
|
|
, fetchFromGitHub
|
|
, ipython
|
|
, orjson
|
|
, packaging
|
|
, pillow
|
|
, poetry-core
|
|
, py
|
|
, pydantic
|
|
, pyjwt
|
|
, pytest-aiohttp
|
|
, pytest-asyncio
|
|
, pytest-benchmark
|
|
, pytest-timeout
|
|
, pytest-xdist
|
|
, pytestCheckHook
|
|
, python-dotenv
|
|
, pythonOlder
|
|
, pytz
|
|
, setuptools
|
|
, setuptools-scm
|
|
, termcolor
|
|
, typer
|
|
, ffmpeg
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pyunifiprotect";
|
|
version = "4.9.0";
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "briis";
|
|
repo = pname;
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-fIkZh/fkeVzQyEa4goGnaCxOWsKLKRlw+0/nGBDmKlY=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace "--cov=pyunifiprotect --cov-append" ""
|
|
'';
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
nativeBuildInputs = [
|
|
setuptools
|
|
setuptools-scm
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
aiofiles
|
|
aiohttp
|
|
aioshutil
|
|
dateparser
|
|
orjson
|
|
packaging
|
|
pillow
|
|
pydantic
|
|
pyjwt
|
|
pytz
|
|
typer
|
|
] ++ typer.optional-dependencies.all;
|
|
|
|
passthru.optional-dependencies = {
|
|
shell = [
|
|
ipython
|
|
python-dotenv
|
|
termcolor
|
|
];
|
|
};
|
|
|
|
nativeCheckInputs = [
|
|
ffmpeg # Required for command ffprobe
|
|
py
|
|
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";
|
|
changelog = "https://github.com/AngellusMortis/pyunifiprotect/releases/tag/v${version}";
|
|
license = with licenses; [ mit ];
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|