1{ lib
2, buildPythonPackage
3, docopt
4, fetchFromGitHub
5, hypothesis
6, passlib
7, poetry-core
8, pytest-asyncio
9, pytestCheckHook
10, pythonOlder
11, pyyaml
12, transitions
13, websockets
14}:
15
16buildPythonPackage rec {
17 pname = "amqtt";
18 version = "0.10.0";
19 format = "pyproject";
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "Yakifo";
24 repo = pname;
25 rev = "v${version}";
26 sha256 = "sha256-27LmNR1KC8w3zRJ7YBlBolQ4Q70ScTPqypMCpU6fO+I=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace 'websockets = "^9.0"' 'websockets = "^10.0"'
32 '';
33
34 nativeBuildInputs = [ poetry-core ];
35
36 propagatedBuildInputs = [
37 docopt
38 passlib
39 pyyaml
40 transitions
41 websockets
42 ];
43
44 checkInputs = [
45 hypothesis
46 pytest-asyncio
47 pytestCheckHook
48 ];
49
50 disabledTestPaths = [
51 # Test are not ported from hbmqtt yet
52 "tests/test_cli.py"
53 "tests/test_client.py"
54 ];
55
56 disabledTests = [
57 # Requires network access
58 "test_connect_tcp"
59 ];
60
61 pythonImportsCheck = [ "amqtt" ];
62
63 meta = with lib; {
64 description = "Python MQTT client and broker implementation";
65 homepage = "https://amqtt.readthedocs.io/";
66 license = with licenses; [ mit ];
67 maintainers = with maintainers; [ fab ];
68 };
69}