depot/third_party/nixpkgs/pkgs/development/python-modules/pyunifiprotect/default.nix
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

100 lines
1.7 KiB
Nix

{ 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.4";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "briis";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-EMKbSNlMTHvwiTPb9jnA2NIG6OhyNJshrRPYpYdHsM8=";
};
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 ];
};
}