1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 poetry-core,
8 pytest-asyncio,
9 pytestCheckHook,
10 pythonOlder,
11 yarl,
12}:
13
14buildPythonPackage rec {
15 pname = "adguardhome";
16 version = "0.7.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.11";
20
21 src = fetchFromGitHub {
22 owner = "frenck";
23 repo = "python-${pname}";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-n55G6ulKcgSSrgPk70D52OO9fp3WURlcRhJQUKrZ1Nk=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail "--cov" "" \
31 --replace-fail '"0.0.0"' '"${version}"'
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 aiohttp
38 yarl
39 ];
40
41 __darwinAllowLocalNetworking = true;
42
43 nativeCheckInputs = [
44 aresponses
45 pytest-asyncio
46 pytestCheckHook
47 ];
48
49 pythonImportsCheck = [ "adguardhome" ];
50
51 meta = with lib; {
52 description = "Python client for the AdGuard Home API";
53 homepage = "https://github.com/frenck/python-adguardhome";
54 changelog = "https://github.com/frenck/python-adguardhome/releases/tag/v${version}";
55 license = licenses.mit;
56 maintainers = with maintainers; [ jamiemagee ];
57 };
58}