Merge pull request #118584 from fabaff/nats

This commit is contained in:
Sandro 2021-04-08 15:40:32 +02:00 committed by GitHub
commit f9544583b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 100 additions and 0 deletions

View file

@ -0,0 +1,50 @@
{ lib
, buildPythonPackage
, ed25519
, fetchFromGitHub
, nats-server
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "asyncio-nats-client";
version = "0.11.4";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "nats-io";
repo = "nats.py";
rev = "v${version}";
sha256 = "1aj57xi2rj1xswq8air13xdsll1ybpi0nmz5f6jq01azm0zy9xyd";
};
propagatedBuildInputs = [
ed25519
];
checkInputs = [
nats-server
pytestCheckHook
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "--cov=nats --cov-report html" ""
'';
disabledTests = [
# RuntimeError: Event loop is closed
"test_subscribe_no_echo"
"test_reconnect_to_new_server_with_auth"
];
pythonImportsCheck = [ "nats.aio" ];
meta = with lib; {
description = "Python client for NATS.io";
homepage = "https://github.com/nats-io/nats.py";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}

View file

@ -0,0 +1,46 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, poetry-core
, pythonOlder
}:
buildPythonPackage rec {
pname = "nats-python";
version = "0.8.0";
disabled = pythonOlder "3.6";
format = "pyproject";
src = fetchFromGitHub {
owner = "Gr1N";
repo = "nats-python";
rev = version;
sha256 = "1j7skyxldir3mphvnsyhjxmf3cimv4h7n5v58jl2gff4yd0hdw7g";
};
nativeBuildInputs = [
poetry-core
];
patches = [
# Switch to poetry-core, https://github.com/Gr1N/nats-python/pull/19
(fetchpatch {
name = "use-poetry-core.patch";
url = "https://github.com/Gr1N/nats-python/commit/71b25b324212dccd7fc06ba3914491adba22e83f.patch";
sha256 = "1fip1qpzk2ka7qgkrdpdr6vnrnb1p8cwapa51xp0h26nm7yis1gl";
})
];
# Tests require a running NATS server
doCheck = false;
pythonImportsCheck = [ "pynats" ];
meta = with lib; {
description = "Python client for NATS messaging system";
homepage = "https://github.com/Gr1N/nats-python";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}

View file

@ -546,6 +546,8 @@ in {
asyncio-mqtt = callPackage ../development/python-modules/asyncio_mqtt { };
asyncio-nats-client = callPackage ../development/python-modules/asyncio-nats-client { };
asyncio-throttle = callPackage ../development/python-modules/asyncio-throttle { };
asyncpg = callPackage ../development/python-modules/asyncpg { };
@ -4527,6 +4529,8 @@ in {
nassl = callPackage ../development/python-modules/nassl { };
nats-python = callPackage ../development/python-modules/nats-python { };
natsort = callPackage ../development/python-modules/natsort { };
naturalsort = callPackage ../development/python-modules/naturalsort { };