2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
aiohttp,
|
|
|
|
buildPythonPackage,
|
|
|
|
ed25519,
|
|
|
|
fetchFromGitHub,
|
|
|
|
nats-server,
|
|
|
|
nkeys,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
uvloop,
|
2021-04-08 16:26:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "nats-py";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "2.8.0";
|
2024-02-07 01:22:34 +00:00
|
|
|
pyproject = true;
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nats-io";
|
|
|
|
repo = "nats.py";
|
2022-04-15 01:41:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-xPjyi5dFR9xVp1Fl6mM2JNKTRlLBQ6J9aB0dpjnZ+eQ=";
|
2021-04-08 16:26:57 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [ ed25519 ];
|
2021-04-08 16:26:57 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-04-21 15:54:59 +00:00
|
|
|
aiohttp = [ aiohttp ];
|
|
|
|
nkeys = [ nkeys ];
|
2024-02-07 01:22:34 +00:00
|
|
|
# fast_parse = [
|
|
|
|
# fast-mail-parser
|
|
|
|
# ];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-08 16:26:57 +00:00
|
|
|
nats-server
|
|
|
|
pytestCheckHook
|
2021-10-17 09:34:42 +00:00
|
|
|
uvloop
|
2021-04-08 16:26:57 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# AssertionError: assert 5 == 0
|
|
|
|
"test_pull_subscribe_limits"
|
|
|
|
"test_fetch_n"
|
|
|
|
"test_subscribe_no_echo"
|
|
|
|
"test_stream_management"
|
|
|
|
# Tests fail on hydra, often Time-out
|
|
|
|
"test_subscribe_iterate_next_msg"
|
|
|
|
"test_ordered_consumer_larger_streams"
|
|
|
|
"test_object_file_basics"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
"test_subscribe_iterate_next_msg"
|
|
|
|
"test_buf_size_force_flush_timeout"
|
|
|
|
];
|
2021-04-08 16:26:57 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "nats" ];
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python client for NATS.io";
|
|
|
|
homepage = "https://github.com/nats-io/nats.py";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/nats-io/nats.py/releases/tag/v${version}";
|
2021-04-08 16:26:57 +00:00
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|