Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pyunifiprotect / default.nix
blob00b0f3740c352b39fe81ff67ecb8d96139561bce
1 { lib
2 , aiofiles
3 , aiohttp
4 , aioshutil
5 , buildPythonPackage
6 , dateparser
7 , fetchFromGitHub
8 , ipython
9 , orjson
10 , packaging
11 , pillow
12 , poetry-core
13 , py
14 , pydantic
15 , pyjwt
16 , pytest-aiohttp
17 , pytest-asyncio
18 , pytest-benchmark
19 , pytest-timeout
20 , pytest-xdist
21 , pytestCheckHook
22 , python-dotenv
23 , pythonOlder
24 , pytz
25 , setuptools
26 , setuptools-scm
27 , termcolor
28 , typer
29 , ffmpeg
32 buildPythonPackage rec {
33   pname = "pyunifiprotect";
34   version = "4.21.0";
35   format = "pyproject";
37   disabled = pythonOlder "3.9";
39   src = fetchFromGitHub {
40     owner = "briis";
41     repo = pname;
42     rev = "refs/tags/v${version}";
43     hash = "sha256-BFcICpWq0aBjEww9EuO6UH8oGX8fufernFqh/gihIrM=";
44   };
46   postPatch = ''
47     substituteInPlace pyproject.toml \
48       --replace "--cov=pyunifiprotect --cov-append" ""
49   '';
51   SETUPTOOLS_SCM_PRETEND_VERSION = version;
53   nativeBuildInputs = [
54     setuptools
55     setuptools-scm
56   ];
58   propagatedBuildInputs = [
59     aiofiles
60     aiohttp
61     aioshutil
62     dateparser
63     orjson
64     packaging
65     pillow
66     pydantic
67     pyjwt
68     pytz
69     typer
70   ] ++ typer.optional-dependencies.all;
72   passthru.optional-dependencies = {
73     shell = [
74       ipython
75       python-dotenv
76       termcolor
77     ];
78   };
80   nativeCheckInputs = [
81     ffmpeg # Required for command ffprobe
82     py
83     pytest-aiohttp
84     pytest-asyncio
85     pytest-benchmark
86     pytest-timeout
87     pytest-xdist
88     pytestCheckHook
89   ];
91   pythonImportsCheck = [
92     "pyunifiprotect"
93   ];
95   pytestFlagsArray = [
96     "--benchmark-disable"
97   ];
99   meta = with lib; {
100     description = "Library for interacting with the Unifi Protect API";
101     homepage = "https://github.com/briis/pyunifiprotect";
102     changelog = "https://github.com/AngellusMortis/pyunifiprotect/releases/tag/v${version}";
103     license = with licenses; [ mit ];
104     maintainers = with maintainers; [ fab ];
105   };