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.14.0";
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-ByVslOx/XsxVan2/xdRi+wOQR9oVpIGtHPcHlIcHMEk=";
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 checkInputs = [
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_unfiltered_messages"
53 "test_client_unsubscribe"
54 "test_client_will"
55 "test_client_tls_context"
56 "test_client_tls_params"
57 "test_client_username_password "
58 "test_client_logger"
59 "test_client_max_concurrent_outgoing_calls"
60 "test_client_websockets"
61 "test_client_pending_calls_threshold"
62 "test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls"
63 ];
64
65 meta = with lib; {
66 description = "Idomatic asyncio wrapper around paho-mqtt";
67 homepage = "https://github.com/sbtinstruments/asyncio-mqtt";
68 license = licenses.bsd3;
69 changelog = "https://github.com/sbtinstruments/asyncio-mqtt/blob/master/CHANGELOG.md";
70 maintainers = with maintainers; [ hexa ];
71 };
72}