1{ lib
2, aiohttp
3, buildPythonPackage
4, click
5, fetchFromGitHub
6, prompt-toolkit
7, pycryptodome
8, pythonOlder
9, setuptools
10}:
11
12buildPythonPackage rec {
13 pname = "pykoplenti";
14 version = "1.0.0";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "stegm";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-XBOKf3i8xywU/1Kzl+VI1Qnkp9ohpSuDX3AnotD32oo=";
24 };
25
26 nativeBuildInputs = [
27 setuptools
28 ];
29
30 postPatch = ''
31 # remove with 1.1.0
32 substituteInPlace setup.cfg \
33 --replace 'version = unreleased' 'version = ${version}'
34 '';
35
36 propagatedBuildInputs = [
37 aiohttp
38 click
39 prompt-toolkit
40 pycryptodome
41 ];
42
43 # Project has no tests
44 doCheck = false;
45
46 pythonImportsCheck = [ "pykoplenti" ];
47
48 meta = with lib; {
49 description = "Python REST client API for Kostal Plenticore Inverters";
50 homepage = "https://github.com/stegm/pykoplenti/";
51 license = with licenses; [ asl20 ];
52 maintainers = with maintainers; [ fab ];
53 };
54}