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