2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, buildPythonPackage
|
|
|
|
, click
|
|
|
|
, fetchFromGitHub
|
2021-08-05 21:33:18 +00:00
|
|
|
, prompt-toolkit
|
2021-05-20 23:08:51 +00:00
|
|
|
, pycryptodome
|
2024-01-02 11:29:13 +00:00
|
|
|
, pydantic
|
2021-05-20 23:08:51 +00:00
|
|
|
, pythonOlder
|
2023-03-15 16:39:30 +00:00
|
|
|
, setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pykoplenti";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.2.2";
|
2023-03-15 16:39:30 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stegm";
|
|
|
|
repo = pname;
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-2sGkHCIGo1lzLurvQBmq+16sodAaK8v+mAbIH/Gd3+E=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# remove with 1.1.0
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace 'version = unreleased' 'version = ${version}'
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
pycryptodome
|
2024-01-02 11:29:13 +00:00
|
|
|
pydantic
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
CLI = [
|
|
|
|
click
|
|
|
|
prompt-toolkit
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# Project has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pykoplenti" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python REST client API for Kostal Plenticore Inverters";
|
|
|
|
homepage = "https://github.com/stegm/pykoplenti/";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|