summary refs log tree commit diff
path: root/pkgs/development/python-modules/meshtastic/default.nix
blob: 8bfb65056f165c33cd6aaad54e05ea767ddccd9e (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{ lib
, buildPythonPackage
, dotmap
, fetchFromGitHub
, pexpect
, protobuf
, pygatt
, pypubsub
, pyqrcode
, pyserial
, pytap2
, pytestCheckHook
, pythonOlder
, pyyaml
, requests
, setuptools
, tabulate
, timeago
}:

buildPythonPackage rec {
  pname = "meshtastic";
  version = "2.2.12";
  format = "setuptools";

  disabled = pythonOlder "3.7";

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

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

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

  nativeCheckInputs = [
    pytap2
    pytestCheckHook
  ];

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

  pythonImportsCheck = [
    "meshtastic"
  ];

  disabledTests = [
    # AttributeError: 'HardwareMessage'...
    "test_handleFromRadio_with_my_info"
    "test_handleFromRadio_with_node_info"
    "test_main_ch_longsfast_on_non_primary_channel"
    "test_main_ch_set_name_with_ch_index"
    "test_main_configure_with_camel_case_keys"
    "test_main_configure_with_snake_case"
    "test_main_export_config_called_from_main"
    "test_main_export_config_use_camel"
    "test_main_export_config"
    "test_main_get_with_invalid"
    "test_main_get_with_valid_values_camel"
    "test_main_getPref_invalid_field_camel"
    "test_main_getPref_invalid_field"
    "test_main_getPref_valid_field_bool_camel"
    "test_main_getPref_valid_field_bool"
    "test_main_getPref_valid_field_camel"
    "test_main_getPref_valid_field_string_camel"
    "test_main_getPref_valid_field_string"
    "test_main_getPref_valid_field"
    "test_main_set_invalid_wifi_passwd"
    "test_main_set_valid_camel_case"
    "test_main_set_valid_wifi_passwd"
    "test_main_set_valid"
    "test_main_set_with_invalid"
    "test_main_setPref_ignore_incoming_0"
    "test_main_setPref_ignore_incoming_123"
    "test_main_setPref_invalid_field_camel"
    "test_main_setPref_invalid_field"
    "test_main_setPref_valid_field_int_as_string"
    "test_readGPIOs"
    "test_onGPIOreceive"
    "test_setURL_empty_url"
    "test_watchGPIOs"
    "test_writeConfig_with_no_radioConfig"
    "test_writeGPIOs"
    "test_reboot"
    "test_shutdown"
    "test_main_sendtext"
    "test_main_sendtext_with_channel"
    "test_MeshInterface"
    "test_getNode_not_local"
    "test_getNode_not_local_timeout"
    "test_main_onConnected_exception"
  ];

  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 ];
  };
}