about summary refs log tree commit diff
path: root/pkgs/development/python-modules/nats-python
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-04-05 15:01:24 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-04-05 15:01:24 +0200
commit4cdb34f8aa4283d4b78efb8ac936581e67581727 (patch)
tree288f1926a4725b2f7faee25fa05ee44f52477a2f /pkgs/development/python-modules/nats-python
parentc8b27b818f418ec76bdbe9286e573d9b1a4c419e (diff)
python3Packages.nats-python: init at 0.8.0
Diffstat (limited to 'pkgs/development/python-modules/nats-python')
-rw-r--r--pkgs/development/python-modules/nats-python/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/nats-python/default.nix b/pkgs/development/python-modules/nats-python/default.nix
new file mode 100644
index 0000000000000..5bf5b2a6d21c5
--- /dev/null
+++ b/pkgs/development/python-modules/nats-python/default.nix
@@ -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 ];
+  };
+}