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