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