1{
2 lib,
3 aiohttp,
4 aioresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 orjson,
8 pytest-aiohttp,
9 pytest-asyncio,
10 pytestCheckHook,
11 pythonOlder,
12 segno,
13 setuptools,
14 trustme,
15}:
16
17buildPythonPackage rec {
18 pname = "aiounifi";
19 version = "79";
20 pyproject = true;
21
22 disabled = pythonOlder "3.11";
23
24 src = fetchFromGitHub {
25 owner = "Kane610";
26 repo = "aiounifi";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-okyUjHWzm2LKyDSmE93qbc8XK4fMQMr9R0L/W7GSeUw=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml \
33 --replace-fail "setuptools==" "setuptools>=" \
34 --replace-fail "wheel==" "wheel>="
35
36 sed -i '/--cov=/d' pyproject.toml
37 '';
38
39 build-system = [ setuptools ];
40
41 dependencies = [
42 aiohttp
43 orjson
44 segno
45 ];
46
47 nativeCheckInputs = [
48 aioresponses
49 pytest-aiohttp
50 pytest-asyncio
51 pytestCheckHook
52 trustme
53 ];
54
55 pytestFlagsArray = [ "--asyncio-mode=auto" ];
56
57 pythonImportsCheck = [ "aiounifi" ];
58
59 meta = with lib; {
60 description = "Python library for communicating with Unifi Controller API";
61 homepage = "https://github.com/Kane610/aiounifi";
62 changelog = "https://github.com/Kane610/aiounifi/releases/tag/v${version}";
63 license = licenses.mit;
64 maintainers = [ ];
65 mainProgram = "aiounifi";
66 };
67}