1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 mock,
6 pyftdi,
7 pyopenssl,
8 pyserial,
9 pytestCheckHook,
10 pythonOlder,
11 pyusb,
12}:
13
14buildPythonPackage rec {
15 pname = "alarmdecoder";
16 version = "1.13.11";
17 format = "setuptools";
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "nutechsoftware";
22 repo = "alarmdecoder";
23 rev = version;
24 hash = "sha256-q2s+wngDKtWm5mxGHNAc63Ed6tiQD9gLHVoQZNWFB0w=";
25 };
26
27 postPatch = ''
28 substituteInPlace test/test_{ad2,devices,messages}.py \
29 --replace-fail assertEquals assertEqual
30 '';
31
32 propagatedBuildInputs = [
33 pyftdi
34 pyopenssl
35 pyserial
36 pyusb
37 ];
38
39 nativeCheckInputs = [
40 mock
41 pytestCheckHook
42 ];
43
44 disabledTests = [
45 # Socket issue, https://github.com/nutechsoftware/alarmdecoder/issues/45
46 "test_ssl"
47 "test_ssl_exception"
48 ];
49
50 pythonImportsCheck = [ "alarmdecoder" ];
51
52 meta = with lib; {
53 description = "Python interface for the Alarm Decoder (AD2USB, AD2SERIAL and AD2PI) devices";
54 homepage = "https://github.com/nutechsoftware/alarmdecoder";
55 license = licenses.mit;
56 maintainers = with maintainers; [ fab ];
57 };
58}