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