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 = "83";
21 pyproject = true;
22
23 disabled = pythonOlder "3.11";
24
25 src = fetchFromGitHub {
26 owner = "Kane610";
27 repo = "aiounifi";
28 tag = "v${version}";
29 hash = "sha256-xWmSrjdlvpPlWALqABwNRxgG+FzOZBj8kF0AZsY7l5Q=";
30 };
31
32 postPatch = ''
33 substituteInPlace pyproject.toml \
34 --replace-fail "setuptools==75.8.2" "setuptools" \
35 --replace-fail "wheel==" "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 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}