1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 click,
6 fetchFromGitHub,
7 prompt-toolkit,
8 pycryptodome,
9 pydantic,
10 pythonOlder,
11 pythonRelaxDepsHook,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "pykoplenti";
17 version = "1.2.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "stegm";
24 repo = "pykoplenti";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-2sGkHCIGo1lzLurvQBmq+16sodAaK8v+mAbIH/Gd3+E=";
27 };
28
29 pythonRelaxDeps = [ "pydantic" ];
30
31 nativeBuildInputs = [
32 pythonRelaxDepsHook
33 setuptools
34 ];
35
36 propagatedBuildInputs = [
37 aiohttp
38 pycryptodome
39 pydantic
40 ];
41
42 passthru.optional-dependencies = {
43 CLI = [
44 click
45 prompt-toolkit
46 ];
47 };
48
49 # Project has no tests
50 doCheck = false;
51
52 pythonImportsCheck = [ "pykoplenti" ];
53
54 meta = with lib; {
55 description = "Python REST client API for Kostal Plenticore Inverters";
56 mainProgram = "pykoplenti";
57 homepage = "https://github.com/stegm/pykoplenti/";
58 changelog = "https://github.com/stegm/pykoplenti/releases/tag/v${version}";
59 license = with licenses; [ asl20 ];
60 maintainers = with maintainers; [ fab ];
61 };
62}