1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchFromGitHub,
6 loguru,
7 numpy,
8 pythonOlder,
9 setuptools,
10 unasync,
11 urllib3,
12}:
13
14buildPythonPackage rec {
15 pname = "pyosohotwaterapi";
16 version = "1.1.4";
17 pyproject = true;
18
19 disabled = pythonOlder "3.10";
20
21 src = fetchFromGitHub {
22 owner = "osohotwateriot";
23 repo = "apyosohotwaterapi";
24 rev = "refs/tags/${version}";
25 hash = "sha256-7FLGmmndrFqSl4oC8QFIYNlFJPr+xbiZG5ZRt4vx8+s=";
26 };
27
28 postPatch = ''
29 # https://github.com/osohotwateriot/apyosohotwaterapi/pull/3
30 substituteInPlace requirements.txt \
31 --replace "pre-commit" ""
32 '';
33
34 nativeBuildInputs = [
35 setuptools
36 unasync
37 ];
38
39 propagatedBuildInputs = [
40 aiohttp
41 loguru
42 numpy
43 urllib3
44 ];
45
46 preBuild = ''
47 export HOME=$(mktemp -d)
48 '';
49
50 # Module has no tests
51 doCheck = false;
52
53 pythonImportsCheck = [ "apyosoenergyapi" ];
54
55 meta = with lib; {
56 description = "Module for using the OSO Hotwater API";
57 homepage = "https://github.com/osohotwateriot/apyosohotwaterapi";
58 changelog = "https://github.com/osohotwateriot/apyosohotwaterapi/releases/tag/${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}