1{ 2 lib, 3 anyio, 4 buildPythonPackage, 5 fetchFromGitHub, 6 paho-mqtt, 7 pytestCheckHook, 8 pythonOlder, 9 setuptools, 10 setuptools-scm, 11 typing-extensions, 12 wheel, 13}: 14 15buildPythonPackage rec { 16 pname = "asyncio-mqtt"; 17 version = "0.16.1"; 18 format = "pyproject"; 19 20 disabled = pythonOlder "3.7"; 21 22 src = fetchFromGitHub { 23 owner = "sbtinstruments"; 24 repo = pname; 25 rev = "refs/tags/v${version}"; 26 hash = "sha256-f3JqocjOEwNjo6Uv17ij6oEdrjb6Z2wTzdhdVhx46iM="; 27 }; 28 29 nativeBuildInputs = [ 30 setuptools 31 setuptools-scm 32 wheel 33 ]; 34 35 propagatedBuildInputs = [ paho-mqtt ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ]; 36 37 nativeCheckInputs = [ 38 anyio 39 pytestCheckHook 40 ]; 41 42 pythonImportsCheck = [ "asyncio_mqtt" ]; 43 44 disabledTests = [ 45 # Tests require network access 46 "test_client_filtered_messages" 47 "test_client_logger" 48 "test_client_max_concurrent_outgoing_calls" 49 "test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls" 50 "test_client_pending_calls_threshold" 51 "test_client_tls_context" 52 "test_client_tls_params" 53 "test_client_unfiltered_messages" 54 "test_client_unsubscribe" 55 "test_client_username_password " 56 "test_client_websockets" 57 "test_client_will" 58 "test_multiple_messages_generators" 59 ]; 60 61 # newer version are packaged as aiomqtt 62 passthru.skipBulkUpdate = true; 63 64 meta = with lib; { 65 description = "Idomatic asyncio wrapper around paho-mqtt"; 66 homepage = "https://github.com/sbtinstruments/asyncio-mqtt"; 67 license = licenses.bsd3; 68 changelog = "https://github.com/sbtinstruments/asyncio-mqtt/blob/v${version}/CHANGELOG.md"; 69 maintainers = with maintainers; [ hexa ]; 70 }; 71}