2022-05-18 14:49:53 +00:00
|
|
|
{ lib
|
2023-02-16 17:41:37 +00:00
|
|
|
, aiohttp
|
|
|
|
, aioresponses
|
2022-05-18 14:49:53 +00:00
|
|
|
, beautifulsoup4
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, html5lib
|
2023-02-16 17:41:37 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-aiohttp
|
2022-05-18 14:49:53 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, requests
|
|
|
|
, requests-mock
|
2023-02-16 17:41:37 +00:00
|
|
|
, setuptools
|
|
|
|
, setuptools-scm
|
2022-05-18 14:49:53 +00:00
|
|
|
, urllib3
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "raincloudy";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "1.2.0";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vanstinator";
|
|
|
|
repo = pname;
|
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
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/vanstinator/raincloudy/pull/60
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "bs4" "beautifulsoup4" \
|
|
|
|
|
|
|
|
# fix raincloudy.aio package discovery, by relying on
|
|
|
|
# autodiscovery instead.
|
|
|
|
sed -i '/packages=/d' setup.py
|
|
|
|
'';
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
propagatedBuildInputs = [
|
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";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|