1{
2 lib,
3 aiohttp,
4 aioresponses,
5 beautifulsoup4,
6 buildPythonPackage,
7 fetchFromGitHub,
8 html5lib,
9 pytest-asyncio,
10 pytest-aiohttp,
11 pytestCheckHook,
12 pythonAtLeast,
13 pythonOlder,
14 requests,
15 requests-mock,
16 setuptools,
17 setuptools-scm,
18 urllib3,
19}:
20
21buildPythonPackage rec {
22 pname = "raincloudy";
23 version = "1.2.0";
24 format = "setuptools";
25 pypriject = true;
26
27 # https://github.com/vanstinator/raincloudy/issues/65
28 disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
29
30 src = fetchFromGitHub {
31 owner = "vanstinator";
32 repo = "raincloudy";
33 rev = "refs/tags/${version}";
34 hash = "sha256-qCkBVirM09iA1sXiOB9FJns8bHjQq7rRk8XbRWrtBDI=";
35 };
36
37 postPatch = ''
38 # https://github.com/vanstinator/raincloudy/pull/60
39 substituteInPlace setup.py \
40 --replace-fail "bs4" "beautifulsoup4" \
41
42 # fix raincloudy.aio package discovery, by relying on
43 # autodiscovery instead.
44 sed -i '/packages=/d' setup.py
45 '';
46
47 build-system = [
48 setuptools
49 setuptools-scm
50 ];
51
52 dependencies = [
53 aiohttp
54 requests
55 beautifulsoup4
56 urllib3
57 html5lib
58 ];
59
60 nativeCheckInputs = [
61 aioresponses
62 pytest-asyncio
63 pytest-aiohttp
64 pytestCheckHook
65 requests-mock
66 ];
67
68 pythonImportsCheck = [
69 "raincloudy"
70 "raincloudy.aio"
71 ];
72
73 disabledTests = [
74 # Test requires network access
75 "test_attributes"
76 ];
77
78 meta = with lib; {
79 description = "Module to interact with Melnor RainCloud Smart Garden Watering Irrigation Timer";
80 homepage = "https://github.com/vanstinator/raincloudy";
81 changelog = "https://github.com/vanstinator/raincloudy/releases/tag/${version}";
82 license = licenses.asl20;
83 maintainers = with maintainers; [ fab ];
84 };
85}