2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
poetry-core,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2021-04-08 16:26:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "nats-python";
|
|
|
|
version = "0.8.0";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Gr1N";
|
|
|
|
repo = "nats-python";
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-7/AGQfPEuSeoRGUXeyDZNbLhapfQa7vhrSPHRruf+sg=";
|
2021-04-08 16:26:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-9AUd/anWCAhuD0VdxRm6Ydlst8nttjwfPmqK+S8ON7o=";
|
2021-04-08 16:26:57 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
|
|
dependencies = [ setuptools ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
# 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";
|
2024-05-15 15:35:15 +00:00
|
|
|
changelog = "https://github.com/Gr1N/nats-python/releases/tag/${version}";
|
2021-04-08 16:26:57 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|