2021-03-15 08:37:03 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, aresponses
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, yarl
|
|
|
|
}:
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "adguardhome";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "0.6.1";
|
2021-03-15 08:37:03 +00:00
|
|
|
format = "pyproject";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "frenck";
|
|
|
|
repo = "python-${pname}";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-ZeajC8FM7Py+DWknVjnwiM4jaCCcnxfC+kTbHEEmyms=";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "--cov" "" \
|
|
|
|
--replace '"0.0.0"' '"${version}"'
|
|
|
|
|
|
|
|
substituteInPlace tests/test_adguardhome.py \
|
|
|
|
--replace 0.0.0 ${version}
|
|
|
|
'';
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
2021-03-15 08:37:03 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
yarl
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-15 08:37:03 +00:00
|
|
|
aresponses
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"adguardhome"
|
|
|
|
];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-03-15 08:37:03 +00:00
|
|
|
description = "Python client for the AdGuard Home API";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://github.com/frenck/python-adguardhome";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/frenck/python-adguardhome/releases/tag/v${version}";
|
2020-10-07 09:15:18 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jamiemagee ];
|
|
|
|
};
|
|
|
|
}
|