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