2021-04-08 16:26:57 +00:00
|
|
|
{ lib
|
2022-09-30 11:47:45 +00:00
|
|
|
, stdenv
|
2022-10-21 18:38:19 +00:00
|
|
|
, aiohttp
|
2021-04-08 16:26:57 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, ed25519
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nats-server
|
2024-02-07 01:22:34 +00:00
|
|
|
, nkeys
|
2021-04-08 16:26:57 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2023-10-09 19:29:22 +00:00
|
|
|
, setuptools
|
2021-10-17 09:34:42 +00:00
|
|
|
, uvloop
|
2021-04-08 16:26:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "nats-py";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "2.7.0";
|
|
|
|
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-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-spKz0rKTI8hWdO6r8VLtP3G8tS9ANsjYRbinXOARCOQ=";
|
2021-04-08 16:26:57 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
ed25519
|
|
|
|
];
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
aiohttp = [
|
|
|
|
aiohttp
|
|
|
|
];
|
|
|
|
nkeys = [
|
|
|
|
nkeys
|
|
|
|
];
|
|
|
|
# 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
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2022-09-30 11:47:45 +00:00
|
|
|
# AssertionError: assert 5 == 0
|
|
|
|
"test_pull_subscribe_limits"
|
2022-02-10 20:34:41 +00:00
|
|
|
"test_fetch_n"
|
2022-09-30 11:47:45 +00:00
|
|
|
"test_subscribe_no_echo"
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_stream_management"
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"test_subscribe_iterate_next_msg"
|
|
|
|
"test_buf_size_force_flush_timeout"
|
2021-04-08 16:26:57 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +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 ];
|
|
|
|
};
|
|
|
|
}
|