2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
|
|
|
aioresponses,
|
|
|
|
beautifulsoup4,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
html5lib,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytest-aiohttp,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
requests-mock,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
urllib3,
|
2022-05-18 14:49:53 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "raincloudy";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "1.2.0";
|
2024-06-05 15:53:02 +00:00
|
|
|
pypriject = true;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# https://github.com/vanstinator/raincloudy/issues/65
|
|
|
|
disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vanstinator";
|
2024-06-05 15:53:02 +00:00
|
|
|
repo = "raincloudy";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-qCkBVirM09iA1sXiOB9FJns8bHjQq7rRk8XbRWrtBDI=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/vanstinator/raincloudy/pull/60
|
|
|
|
substituteInPlace setup.py \
|
2024-06-05 15:53:02 +00:00
|
|
|
--replace-fail "bs4" "beautifulsoup4" \
|
2023-02-16 17:41:37 +00:00
|
|
|
|
|
|
|
# fix raincloudy.aio package discovery, by relying on
|
|
|
|
# autodiscovery instead.
|
|
|
|
sed -i '/packages=/d' setup.py
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
dependencies = [
|
2023-02-16 17:41:37 +00:00
|
|
|
aiohttp
|
2022-05-18 14:49:53 +00:00
|
|
|
requests
|
|
|
|
beautifulsoup4
|
|
|
|
urllib3
|
|
|
|
html5lib
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-02-16 17:41:37 +00:00
|
|
|
aioresponses
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-aiohttp
|
2022-05-18 14:49:53 +00:00
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"raincloudy"
|
2023-02-16 17:41:37 +00:00
|
|
|
"raincloudy.aio"
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Test requires network access
|
|
|
|
"test_attributes"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Module to interact with Melnor RainCloud Smart Garden Watering Irrigation Timer";
|
|
|
|
homepage = "https://github.com/vanstinator/raincloudy";
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/vanstinator/raincloudy/releases/tag/${version}";
|
|
|
|
license = licenses.asl20;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|