2023-03-08 16:32:21 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, aresponses
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, poetry-core
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-freezer
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, yarl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "easyenergy";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "2.1.0";
|
|
|
|
pyproject = true;
|
2023-03-08 16:32:21 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabled = pythonOlder "3.11";
|
2023-03-08 16:32:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "klaasnicolaas";
|
|
|
|
repo = "python-easyenergy";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-WnDyGkF1JI0Yu4p+znBdtCRvzrmGl9DH7QygKDuhEZo=";
|
2023-03-08 16:32:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace '"0.0.0"' '"${version}"' \
|
|
|
|
--replace 'addopts = "--cov"' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
yarl
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
aresponses
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-freezer
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"easyenergy"
|
|
|
|
];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_json_request"
|
|
|
|
"test_internal_session"
|
|
|
|
"test_electricity_model_usage"
|
|
|
|
"test_electricity_model_return"
|
|
|
|
"test_electricity_none_data"
|
|
|
|
"test_no_electricity_data"
|
|
|
|
"test_gas_morning_model"
|
|
|
|
"test_gas_model"
|
|
|
|
"test_gas_none_data"
|
|
|
|
"test_no_gas_data"
|
2023-03-30 22:05:00 +00:00
|
|
|
"test_electricity_midnight"
|
2023-03-24 00:07:29 +00:00
|
|
|
];
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Module for getting energy/gas prices from easyEnergy";
|
|
|
|
homepage = "https://github.com/klaasnicolaas/python-easyenergy";
|
|
|
|
changelog = "https://github.com/klaasnicolaas/python-easyenergy/releases/tag/v${version}";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|