1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 poetry-core,
8 pytest-asyncio,
9 pytest-freezer,
10 pytestCheckHook,
11 pythonOlder,
12 yarl,
13}:
14
15buildPythonPackage rec {
16 pname = "energyzero";
17 version = "2.1.0";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.11";
21
22 src = fetchFromGitHub {
23 owner = "klaasnicolaas";
24 repo = "python-energyzero";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-NZbCiLCZC+hTcV0twOeCoKKD3eZ0/ZzPTnVpFyMLSfw=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace '"0.0.0"' '"${version}"' \
32 --replace 'addopts = "--cov"' ""
33 '';
34
35 nativeBuildInputs = [ poetry-core ];
36
37 propagatedBuildInputs = [
38 aiohttp
39 yarl
40 ];
41
42 nativeCheckInputs = [
43 aresponses
44 pytest-asyncio
45 pytest-freezer
46 pytestCheckHook
47 ];
48
49 pythonImportsCheck = [ "energyzero" ];
50
51 meta = with lib; {
52 description = "Module for getting the dynamic prices from EnergyZero";
53 homepage = "https://github.com/klaasnicolaas/python-energyzero";
54 changelog = "https://github.com/klaasnicolaas/python-energyzero/releases/tag/v${version}";
55 license = with licenses; [ mit ];
56 maintainers = with maintainers; [ fab ];
57 };
58}