2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, aiofiles
|
|
|
|
, aiohttp
|
|
|
|
, aioshutil
|
|
|
|
, buildPythonPackage
|
2022-09-30 11:47:45 +00:00
|
|
|
, dateparser
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, ipython
|
2022-07-14 12:49:19 +00:00
|
|
|
, orjson
|
2022-06-16 17:23:12 +00:00
|
|
|
, packaging
|
|
|
|
, pillow
|
|
|
|
, poetry-core
|
2023-01-20 10:41:00 +00:00
|
|
|
, py
|
2022-06-16 17:23:12 +00:00
|
|
|
, pydantic
|
|
|
|
, pyjwt
|
|
|
|
, pytest-aiohttp
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-benchmark
|
|
|
|
, pytest-timeout
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-dotenv
|
|
|
|
, pythonOlder
|
|
|
|
, pytz
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2023-01-20 10:41:00 +00:00
|
|
|
, setuptools-scm
|
2022-06-16 17:23:12 +00:00
|
|
|
, termcolor
|
|
|
|
, typer
|
2022-09-09 14:08:57 +00:00
|
|
|
, ffmpeg
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyunifiprotect";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "4.10.5";
|
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}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-BrdffDuPTn/uFKT9F0pF1+0/MraIPRwsN64DdseQdQA=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2022-11-21 17:40:18 +00:00
|
|
|
--replace "--cov=pyunifiprotect --cov-append" ""
|
2022-09-09 14:08:57 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
2023-01-20 10:41:00 +00:00
|
|
|
setuptools-scm
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiofiles
|
|
|
|
aiohttp
|
|
|
|
aioshutil
|
2022-09-30 11:47:45 +00:00
|
|
|
dateparser
|
2022-07-14 12:49:19 +00:00
|
|
|
orjson
|
2022-06-16 17:23:12 +00:00
|
|
|
packaging
|
|
|
|
pillow
|
|
|
|
pydantic
|
|
|
|
pyjwt
|
|
|
|
pytz
|
|
|
|
typer
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ typer.optional-dependencies.all;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
shell = [
|
|
|
|
ipython
|
|
|
|
python-dotenv
|
|
|
|
termcolor
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
ffmpeg # Required for command ffprobe
|
2023-01-20 10:41:00 +00:00
|
|
|
py
|
2022-06-16 17:23:12 +00:00
|
|
|
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";
|
2022-11-21 17:40:18 +00:00
|
|
|
changelog = "https://github.com/AngellusMortis/pyunifiprotect/releases/tag/v${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|