2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
iso4217,
|
|
|
|
pytest-asyncio,
|
|
|
|
pythonOlder,
|
|
|
|
pytz,
|
2021-10-07 14:46:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyefergy";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "22.1.1";
|
2021-10-07 14:46:35 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tkdrob";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
hash = "sha256-AdoM+PcVoajxhnEfkyN9UuNufChu8XGmZDLNC3mjrps=";
|
2021-10-07 14:46:35 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
postPatch = ''
|
|
|
|
# setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'master'
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'version="master",' 'version="${version}",'
|
|
|
|
'';
|
|
|
|
|
2021-10-07 14:46:35 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
iso4217
|
|
|
|
pytz
|
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
# Tests require network access
|
2024-06-05 15:53:02 +00:00
|
|
|
doCheck = false;
|
2021-10-07 14:46:35 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pyefergy" ];
|
2021-10-07 14:46:35 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python API library for Efergy energy meters";
|
|
|
|
homepage = "https://github.com/tkdrob/pyefergy";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|