Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 aiohttp, 5 buildPythonPackage, 6 ed25519, 7 fetchFromGitHub, 8 nats-server, 9 nkeys, 10 pytestCheckHook, 11 pythonOlder, 12 setuptools, 13 uvloop, 14}: 15 16buildPythonPackage rec { 17 pname = "nats-py"; 18 version = "2.11.0"; 19 pyproject = true; 20 21 disabled = pythonOlder "3.7"; 22 23 src = fetchFromGitHub { 24 owner = "nats-io"; 25 repo = "nats.py"; 26 tag = "v${version}"; 27 hash = "sha256-wILjBhdlNU8U2lyJm4CmPy4DzOjJ7cBIkawKwW5KVgg="; 28 }; 29 30 build-system = [ setuptools ]; 31 32 dependencies = [ ed25519 ]; 33 34 optional-dependencies = { 35 aiohttp = [ aiohttp ]; 36 nkeys = [ nkeys ]; 37 # fast_parse = [ fast-mail-parser ]; 38 }; 39 40 nativeCheckInputs = [ 41 nats-server 42 pytestCheckHook 43 uvloop 44 ]; 45 46 disabledTests = [ 47 # Timeouts 48 "ClientTLS" 49 # AssertionError 50 "test_fetch_n" 51 "test_kv_simple" 52 "test_pull_subscribe_limits" 53 "test_stream_management" 54 "test_subscribe_no_echo" 55 # Tests fail on hydra, often Time-out 56 "test_subscribe_iterate_next_msg" 57 "test_ordered_consumer_larger_streams" 58 "test_object_file_basics" 59 ] 60 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 61 "test_subscribe_iterate_next_msg" 62 "test_buf_size_force_flush_timeout" 63 ]; 64 65 pythonImportsCheck = [ "nats" ]; 66 67 meta = with lib; { 68 description = "Python client for NATS.io"; 69 homepage = "https://github.com/nats-io/nats.py"; 70 changelog = "https://github.com/nats-io/nats.py/releases/tag/${src.tag}"; 71 license = with licenses; [ asl20 ]; 72 maintainers = with maintainers; [ fab ]; 73 }; 74}