1{ lib
2, buildPythonPackage
3, ed25519
4, fetchFromGitHub
5, nats-server
6, pytestCheckHook
7, pythonOlder
8, uvloop
9}:
10
11buildPythonPackage rec {
12 pname = "asyncio-nats-client";
13 version = "0.11.4";
14 disabled = pythonOlder "3.6";
15
16 src = fetchFromGitHub {
17 owner = "nats-io";
18 repo = "nats.py";
19 rev = "v${version}";
20 sha256 = "1aj57xi2rj1xswq8air13xdsll1ybpi0nmz5f6jq01azm0zy9xyd";
21 };
22
23 propagatedBuildInputs = [
24 ed25519
25 ];
26
27 checkInputs = [
28 nats-server
29 pytestCheckHook
30 uvloop
31 ];
32
33 postPatch = ''
34 substituteInPlace setup.cfg \
35 --replace "--cov=nats --cov-report html" ""
36 '';
37
38 disabledTests = [
39 # RuntimeError: Event loop is closed
40 "test_subscribe_no_echo"
41 "test_reconnect_to_new_server_with_auth"
42 "test_drain_connection"
43 "test_discover_servers_on_first_connect"
44 ];
45
46 pythonImportsCheck = [ "nats.aio" ];
47
48 meta = with lib; {
49 description = "Python client for NATS.io";
50 homepage = "https://github.com/nats-io/nats.py";
51 license = with licenses; [ asl20 ];
52 maintainers = with maintainers; [ fab ];
53 };
54}