nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, ed25519
4, fetchFromGitHub
5, nats-server
6, pytestCheckHook
7, pythonOlder
8, uvloop
9}:
10
11buildPythonPackage rec {
12 pname = "nats-py";
13 version = "2.1.2";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "nats-io";
20 repo = "nats.py";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-i197ZePxngAhGh7xzaJoo7m8el+7t7yJrvhO2CTmajU=";
23 };
24
25 propagatedBuildInputs = [
26 ed25519
27 ];
28
29 checkInputs = [
30 nats-server
31 pytestCheckHook
32 uvloop
33 ];
34
35 postPatch = ''
36 substituteInPlace setup.cfg \
37 --replace "--cov=nats --cov-report html" ""
38 '';
39
40 disabledTests = [
41 # RuntimeError: Event loop is closed
42 "test_subscribe_no_echo"
43 "test_publish"
44 "test_publish_verbose"
45 "test_fetch_max_waiting_fetch_one"
46 "test_fetch_n"
47 "test_consumer_management"
48 "test_ephemeral_subscribe"
49 "test_queue_subscribe_deliver_group"
50 "test_subscribe_push_bound"
51 "test_double_acking_subscribe"
52 "test_flow_control"
53 "test_ordered_consumer"
54 "test_ordered_consumer_single_loss"
55 "test_kv_simple"
56 ];
57
58 pythonImportsCheck = [
59 "nats"
60 ];
61
62 meta = with lib; {
63 description = "Python client for NATS.io";
64 homepage = "https://github.com/nats-io/nats.py";
65 license = with licenses; [ asl20 ];
66 maintainers = with maintainers; [ fab ];
67 };
68}