2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, aiofiles
|
|
|
|
, aiohttp
|
|
|
|
, aioshutil
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ipython
|
2022-07-14 12:49:19 +00:00
|
|
|
, orjson
|
2022-06-16 17:23:12 +00:00
|
|
|
, packaging
|
|
|
|
, pillow
|
|
|
|
, poetry-core
|
|
|
|
, pydantic
|
|
|
|
, pyjwt
|
|
|
|
, pytest-aiohttp
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-benchmark
|
|
|
|
, pytest-timeout
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-dotenv
|
|
|
|
, pythonOlder
|
|
|
|
, pytz
|
|
|
|
, termcolor
|
|
|
|
, typer
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyunifiprotect";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "4.1.1";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "briis";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-ID3KSKPtgslS1Z+BZprMcTSQUnQbiHKgGQQipOSER9g=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiofiles
|
|
|
|
aiohttp
|
|
|
|
aioshutil
|
2022-07-14 12:49:19 +00:00
|
|
|
orjson
|
2022-06-16 17:23:12 +00:00
|
|
|
packaging
|
|
|
|
pillow
|
|
|
|
pydantic
|
|
|
|
pyjwt
|
|
|
|
pytz
|
|
|
|
typer
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
shell = [
|
|
|
|
ipython
|
|
|
|
python-dotenv
|
|
|
|
termcolor
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-aiohttp
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-benchmark
|
|
|
|
pytest-timeout
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "--cov=pyunifiprotect --cov-append" ""
|
2022-08-12 12:06:08 +00:00
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "pydantic!=1.9.1" "pydantic"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|