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
|
|
|
|
, 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";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.4.0";
|
|
|
|
format = "pyproject";
|
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}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-6t4BTUWjzTbegPvySv9Y6pQrRDwparuYb6rC+HOXWLo=";
|
2021-04-08 16:26:57 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace '"--cov=nats", "--cov-report=html"' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-10-21 18:38:19 +00:00
|
|
|
aiohttp
|
2021-04-08 16:26:57 +00:00
|
|
|
ed25519
|
|
|
|
];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|