2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, docopt
|
|
|
|
, fetchFromGitHub
|
2022-01-19 23:45:15 +00:00
|
|
|
, fetchpatch
|
2021-05-20 23:08:51 +00:00
|
|
|
, hypothesis
|
|
|
|
, passlib
|
|
|
|
, poetry-core
|
2022-01-19 23:45:15 +00:00
|
|
|
, pytest-logdog
|
2021-05-20 23:08:51 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pyyaml
|
|
|
|
, transitions
|
|
|
|
, websockets
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "amqtt";
|
2022-01-19 23:45:15 +00:00
|
|
|
version = "unstable-2022-01-11";
|
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-01-19 23:45:15 +00:00
|
|
|
rev = "8961b8fff57007a5d9907b98bc555f0519974ce9";
|
|
|
|
hash = "sha256-3uwz4RSoa6KRC8mlVfeIMLPH6F2kOJjQjjXCrnVX0Jo=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
docopt
|
|
|
|
passlib
|
|
|
|
pyyaml
|
|
|
|
transitions
|
|
|
|
websockets
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
hypothesis
|
2022-01-19 23:45:15 +00:00
|
|
|
pytest-logdog
|
2021-05-20 23:08:51 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'PyYAML = "^5.4.0"' 'PyYAML = "*"'
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Test are not ported from hbmqtt yet
|
|
|
|
"tests/test_cli.py"
|
|
|
|
"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
|
|
|
|
2022-01-19 23:45:15 +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 ];
|
|
|
|
};
|
|
|
|
}
|