Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pyunifiprotect / default.nix
blob7b7a042ad8be61c2fe28b04ca09093498f79f053
1 { lib
2 , aiofiles
3 , aiohttp
4 , aioshutil
5 , async-timeout
6 , buildPythonPackage
7 , dateparser
8 , fetchFromGitHub
9 , ffmpeg
10 , hatch-vcs
11 , hatchling
12 , ipython
13 , orjson
14 , packaging
15 , pillow
16 , platformdirs
17 , poetry-core
18 , py
19 , pydantic
20 , pyjwt
21 , pytest-aiohttp
22 , pytest-asyncio
23 , pytest-benchmark
24 , pytest-timeout
25 , pytest-xdist
26 , pytestCheckHook
27 , python-dotenv
28 , pythonOlder
29 , pytz
30 , termcolor
31 , typer
34 buildPythonPackage rec {
35   pname = "pyunifiprotect";
36   version = "5.1.2";
37   pyproject = true;
39   disabled = pythonOlder "3.9";
41   src = fetchFromGitHub {
42     owner = "briis";
43     repo = "pyunifiprotect";
44     rev = "refs/tags/v${version}";
45     hash = "sha256-DtQm6u3O0kdVJ23Ch+hJQ6HTOt5iAMdhCzC1K/oICWk=";
46   };
48   env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
50   postPatch = ''
51     substituteInPlace pyproject.toml \
52       --replace-fail "--strict-markers -ra -Wd --ignore=.* --no-cov-on-fail --cov=pyunifiprotect --cov-append --maxfail=10 -n=auto" ""
53   '';
55   build-system = [
56     hatch-vcs
57     hatchling
58   ];
60   dependencies = [
61     aiofiles
62     aiohttp
63     aioshutil
64     dateparser
65     orjson
66     packaging
67     pillow
68     platformdirs
69     pydantic
70     pyjwt
71     pytz
72     typer
73   ] ++ typer.optional-dependencies.all
74   ++ lib.optionals (pythonOlder "3.11") [
75     async-timeout
76   ];
78   passthru.optional-dependencies = {
79     shell = [
80       ipython
81       python-dotenv
82       termcolor
83     ];
84   };
86   nativeCheckInputs = [
87     ffmpeg # Required for command ffprobe
88     py
89     pytest-aiohttp
90     pytest-asyncio
91     pytest-benchmark
92     pytest-timeout
93     pytest-xdist
94     pytestCheckHook
95   ];
97   pythonImportsCheck = [
98     "pyunifiprotect"
99   ];
101   pytestFlagsArray = [
102     "--benchmark-disable"
103   ];
105   meta = with lib; {
106     description = "Library for interacting with the Unifi Protect API";
107     mainProgram = "unifi-protect";
108     homepage = "https://github.com/briis/pyunifiprotect";
109     changelog = "https://github.com/AngellusMortis/pyunifiprotect/releases/tag/v${version}";
110     license = with licenses; [ mit ];
111     maintainers = with maintainers; [ fab ];
112   };