2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, dotmap
|
2021-12-24 04:21:11 +00:00
|
|
|
, fetchFromGitHub
|
2021-05-20 23:08:51 +00:00
|
|
|
, pexpect
|
|
|
|
, protobuf
|
|
|
|
, pygatt
|
|
|
|
, pypubsub
|
|
|
|
, pyqrcode
|
|
|
|
, pyserial
|
2021-12-24 04:21:11 +00:00
|
|
|
, pytestCheckHook
|
2021-05-20 23:08:51 +00:00
|
|
|
, pythonOlder
|
2021-12-24 04:21:11 +00:00
|
|
|
, pyyaml
|
2021-05-20 23:08:51 +00:00
|
|
|
, tabulate
|
2022-01-03 16:56:52 +00:00
|
|
|
, pytap2
|
2021-05-20 23:08:51 +00:00
|
|
|
, timeago
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "meshtastic";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "2.0.9";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "meshtastic";
|
|
|
|
repo = "Meshtastic-python";
|
2022-10-30 15:09:59 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-01-11 07:51:40 +00:00
|
|
|
hash = "sha256-3OA61cuj9u6ejkQJgCjnu8ERjACKXz2hUekbvZqiPJ8=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
dotmap
|
|
|
|
pexpect
|
|
|
|
protobuf
|
|
|
|
pygatt
|
|
|
|
pypubsub
|
|
|
|
pyqrcode
|
|
|
|
pyserial
|
2021-12-24 04:21:11 +00:00
|
|
|
pyyaml
|
2021-05-20 23:08:51 +00:00
|
|
|
tabulate
|
|
|
|
timeago
|
|
|
|
];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
tunnel = [
|
|
|
|
pytap2
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
checkInputs = [
|
2022-01-03 16:56:52 +00:00
|
|
|
pytap2
|
2021-12-24 04:21:11 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export PATH="$PATH:$out/bin";
|
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"meshtastic"
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
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"
|
2022-12-28 21:21:41 +00:00
|
|
|
"test_onGPIOreceive"
|
2022-09-30 11:47:45 +00:00
|
|
|
"test_setURL_empty_url"
|
|
|
|
"test_watchGPIOs"
|
|
|
|
"test_writeConfig_with_no_radioConfig"
|
|
|
|
"test_writeGPIOs"
|
2022-11-27 09:42:12 +00:00
|
|
|
"test_reboot"
|
|
|
|
"test_shutdown"
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python API for talking to Meshtastic devices";
|
2022-09-30 11:47:45 +00:00
|
|
|
homepage = "https://github.com/meshtastic/Meshtastic-python";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/meshtastic/python/releases/tag/${version}";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|