depot/third_party/nixpkgs/pkgs/development/python-modules/nats-py/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

70 lines
1.3 KiB
Nix

{ lib
, stdenv
, aiohttp
, buildPythonPackage
, ed25519
, fetchFromGitHub
, nats-server
, pytestCheckHook
, pythonOlder
, setuptools
, uvloop
}:
buildPythonPackage rec {
pname = "nats-py";
version = "2.4.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "nats-io";
repo = "nats.py";
rev = "refs/tags/v${version}";
hash = "sha256-6t4BTUWjzTbegPvySv9Y6pQrRDwparuYb6rC+HOXWLo=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace '"--cov=nats", "--cov-report=html"' ""
'';
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [
aiohttp
ed25519
];
nativeCheckInputs = [
nats-server
pytestCheckHook
uvloop
];
disabledTests = [
# AssertionError: assert 5 == 0
"test_pull_subscribe_limits"
"test_fetch_n"
"test_subscribe_no_echo"
"test_stream_management"
] ++ lib.optionals stdenv.isDarwin [
"test_subscribe_iterate_next_msg"
"test_buf_size_force_flush_timeout"
];
pythonImportsCheck = [
"nats"
];
meta = with lib; {
description = "Python client for NATS.io";
homepage = "https://github.com/nats-io/nats.py";
changelog = "https://github.com/nats-io/nats.py/releases/tag/v${version}";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}