depot/third_party/nixpkgs/pkgs/development/python-modules/pyunifiprotect/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

97 lines
1.6 KiB
Nix

{ lib
, aiofiles
, aiohttp
, aioshutil
, buildPythonPackage
, fetchFromGitHub
, ipython
, orjson
, 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";
version = "4.1.1";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "briis";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-ID3KSKPtgslS1Z+BZprMcTSQUnQbiHKgGQQipOSER9g=";
};
propagatedBuildInputs = [
aiofiles
aiohttp
aioshutil
orjson
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" ""
substituteInPlace setup.cfg \
--replace "pydantic!=1.9.1" "pydantic"
'';
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 ];
};
}