1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, poetry-core
6, pyserial-asyncio
7, pytest-asyncio
8, pytestCheckHook
9, pythonOlder
10}:
11
12buildPythonPackage rec {
13 pname = "elkm1-lib";
14 version = "1.0.0";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.6";
18
19 src = fetchFromGitHub {
20 owner = "gwww";
21 repo = "elkm1";
22 rev = version;
23 sha256 = "04xidix6l5d9rqfwp6cmj6wvais04nlvz5ynp0zwgyjp9sh2nhp6";
24 };
25
26 nativeBuildInputs = [
27 poetry-core
28 ];
29
30 propagatedBuildInputs = [
31 pyserial-asyncio
32 ];
33
34 checkInputs = [
35 pytest-asyncio
36 pytestCheckHook
37 ];
38
39 patches = [
40 # Switch to poetry-core, https://github.com/gwww/elkm1/pull/45
41 (fetchpatch {
42 name = "switch-to-poetry-core.patch";
43 url = "https://github.com/gwww/elkm1/commit/807a17268498298908bf82af4933b158b37c8f32.patch";
44 sha256 = "1539g8wsxppqj6dm6w81ps05frb8vrfaxahxn2cqs76zdhvly3p9";
45 })
46 ];
47
48 pythonImportsCheck = [ "elkm1_lib" ];
49
50 meta = with lib; {
51 description = "Python module for interacting with ElkM1 alarm/automation panel";
52 homepage = "https://github.com/gwww/elkm1";
53 license = licenses.mit;
54 maintainers = with maintainers; [ fab ];
55 };
56}