2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
docopt,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hypothesis,
|
|
|
|
passlib,
|
|
|
|
poetry-core,
|
|
|
|
pytest-logdog,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
setuptools,
|
|
|
|
transitions,
|
|
|
|
websockets,
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "amqtt";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "unstable-2022-05-29";
|
2021-05-20 23:08:51 +00:00
|
|
|
format = "pyproject";
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Yakifo";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "09ac98d39a711dcff0d8f22686916e1c2495144b";
|
|
|
|
hash = "sha256-8T1XhBSOiArlUQbQ41LsUogDgOurLhf+M8mjIrrAC4s=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2023-04-12 12:48:02 +00:00
|
|
|
--replace 'transitions = "^0.8.0"' 'transitions = "*"' \
|
|
|
|
--replace 'websockets = ">=9.0,<11.0"' 'websockets = "*"'
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
docopt
|
|
|
|
passlib
|
|
|
|
pyyaml
|
2022-09-30 11:47:45 +00:00
|
|
|
setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
transitions
|
|
|
|
websockets
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
hypothesis
|
2022-01-19 23:45:15 +00:00
|
|
|
pytest-logdog
|
2021-05-20 23:08:51 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "--asyncio-mode=auto" ];
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabledTests = lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# stuck in epoll
|
|
|
|
"test_publish_qos0"
|
|
|
|
"test_publish_qos1"
|
|
|
|
"test_publish_qos1_retry"
|
|
|
|
"test_publish_qos2"
|
|
|
|
"test_publish_qos2_retry"
|
|
|
|
"test_receive_qos0"
|
|
|
|
"test_receive_qos1"
|
|
|
|
"test_receive_qos2"
|
|
|
|
"test_start_stop"
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Test are not ported from hbmqtt yet
|
|
|
|
"tests/test_client.py"
|
|
|
|
];
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
preCheck = ''
|
|
|
|
# Some tests need amqtt
|
|
|
|
export PATH=$out/bin:$PATH
|
|
|
|
'';
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "amqtt" ];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python MQTT client and broker implementation";
|
|
|
|
homepage = "https://amqtt.readthedocs.io/";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|