2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, aiofiles
|
|
|
|
, aiohttp
|
|
|
|
, aioshutil
|
2024-01-02 11:29:13 +00:00
|
|
|
, async-timeout
|
2022-06-16 17:23:12 +00:00
|
|
|
, buildPythonPackage
|
2022-09-30 11:47:45 +00:00
|
|
|
, dateparser
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, ffmpeg
|
|
|
|
, hatch-vcs
|
|
|
|
, hatchling
|
2022-06-16 17:23:12 +00:00
|
|
|
, 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
|
|
|
|
, termcolor
|
|
|
|
, typer
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyunifiprotect";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "4.23.2";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "briis";
|
2024-01-02 11:29:13 +00:00
|
|
|
repo = "pyunifiprotect";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-X4LRi2hNpKgnmk3GeoI+ziboBKIosSZye5lPWaBPL1s=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-01-02 11:29:13 +00:00
|
|
|
--replace "--strict-markers -ra -Wd --ignore=.* --no-cov-on-fail --cov=pyunifiprotect --cov-append --maxfail=10 -n=auto" ""
|
2022-09-09 14:08:57 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
2024-01-02 11:29:13 +00:00
|
|
|
hatch-vcs
|
|
|
|
hatchling
|
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
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ typer.optional-dependencies.all
|
|
|
|
++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
async-timeout
|
|
|
|
];
|
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 ];
|
|
|
|
};
|
|
|
|
}
|