1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchFromGitHub,
6 iso4217,
7 pytest-asyncio,
8 pythonOlder,
9 pytz,
10}:
11
12buildPythonPackage rec {
13 pname = "pyefergy";
14 version = "22.1.1";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "tkdrob";
21 repo = pname;
22 rev = version;
23 hash = "sha256-AdoM+PcVoajxhnEfkyN9UuNufChu8XGmZDLNC3mjrps=";
24 };
25
26 postPatch = ''
27 # setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'master'
28 substituteInPlace setup.py \
29 --replace 'version="master",' 'version="${version}",'
30 '';
31
32 propagatedBuildInputs = [
33 aiohttp
34 iso4217
35 pytz
36 ];
37
38 # Tests require network access
39 doCheck = false;
40
41 pythonImportsCheck = [ "pyefergy" ];
42
43 meta = with lib; {
44 description = "Python API library for Efergy energy meters";
45 homepage = "https://github.com/tkdrob/pyefergy";
46 license = with licenses; [ mit ];
47 maintainers = with maintainers; [ fab ];
48 };
49}