about summary refs log tree commit diff
path: root/pkgs/development/python-modules/meshtastic/default.nix
blob: bc00d859f6b837bac6912da4ff8efcaa938d264f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{ lib
, bleak
, buildPythonPackage
, dotmap
, fetchFromGitHub
, pexpect
, protobuf
, pygatt
, pypubsub
, pyqrcode
, pyserial
, pytap2
, pytestCheckHook
, pythonOlder
, pyyaml
, requests
, setuptools
, tabulate
, timeago
}:

buildPythonPackage rec {
  pname = "meshtastic";
  version = "2.3.3";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "meshtastic";
    repo = "Meshtastic-python";
    rev = "refs/tags/${version}";
    hash = "sha256-kydZgOiQHDovQ5RwyLru2nyHoCEVZClq8wJit/mnbvU=";
  };

  build-system = [
    setuptools
  ];

  dependencies = [
    bleak
    dotmap
    pexpect
    protobuf
    pygatt
    pypubsub
    pyqrcode
    pyserial
    pyyaml
    requests
    setuptools
    tabulate
    timeago
  ];

  passthru.optional-dependencies = {
    tunnel = [
      pytap2
    ];
  };

  nativeCheckInputs = [
    pytap2
    pytestCheckHook
  ];

  preCheck = ''
    export PATH="$PATH:$out/bin";
  '';

  pythonImportsCheck = [
    "meshtastic"
  ];

  disabledTests = [
    # TypeError
    "test_main_info"
    "test_main_support"
    "test_main_info_with_tcp_interfa"
    "test_main_no_proto"
    "test_main_info_with_seriallog_stdout"
    "test_main_info_with_seriallog_output_txt"
    "test_support_info"
  ];

  meta = with lib; {
    description = "Python API for talking to Meshtastic devices";
    homepage = "https://github.com/meshtastic/Meshtastic-python";
    changelog = "https://github.com/meshtastic/python/releases/tag/${version}";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ fab ];
  };
}