Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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.6.1";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "frenck";
22 repo = "python-${pname}";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-ZeajC8FM7Py+DWknVjnwiM4jaCCcnxfC+kTbHEEmyms=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace "--cov" "" \
30 --replace '"0.0.0"' '"${version}"'
31
32 substituteInPlace tests/test_adguardhome.py \
33 --replace 0.0.0 ${version}
34 '';
35
36 nativeBuildInputs = [
37 poetry-core
38 ];
39
40 propagatedBuildInputs = [
41 aiohttp
42 yarl
43 ];
44
45 nativeCheckInputs = [
46 aresponses
47 pytest-asyncio
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [
52 "adguardhome"
53 ];
54
55 meta = with lib; {
56 description = "Python client for the AdGuard Home API";
57 homepage = "https://github.com/frenck/python-adguardhome";
58 changelog = "https://github.com/frenck/python-adguardhome/releases/tag/v${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ jamiemagee ];
61 };
62}