Subject: [bug#45514] [PATCH 7/8] gnu: Add python-zulip.

From: Giacomo Leidi <[email-masked]>
Date: Mon, 28 Dec 2020 22:32:44 +0100

* gnu/packages/python-xyz.scm (python-zulip): New variable.
---
 gnu/packages/python-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8a00bebe3e..e25ebda63b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -23328,3 +23328,52 @@ the output of Python’s cProfile module and an alternative to
 using the standard library pstats module.
 It was originally inspired by RunSnakeRun. ")
     (license license:bsd-3)))
+
+(define-public python-zulip
+  (package
+    (name "python-zulip")
+    (version "0.7.1")
+    (source
+     (origin
+       ;; There is no source on Pypi.
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/zulip/python-zulip-api")
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0da1ki1v252avy27j6d7snnc0gyq0xa9fypm3qdmxhw2w79d6q36"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'cd-to-zulip-dir
+           (lambda _
+             (chdir "zulip")
+             #t))
+         (replace 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((test-zulip "../tools/test-zulip"))
+               (add-installed-pythonpath inputs outputs)
+               (setenv "PYTHONPATH" (string-append ".:" (getenv "PYTHONPATH")))
+               (patch-shebang test-zulip)
+               (invoke test-zulip)))))))
+    (propagated-inputs
+     `(("python-matrix-client" ,python-matrix-client)
+       ("python-pyopenssl" ,python-pyopenssl)
+       ("python-requests" ,python-requests)
+       ("python-six" ,python-six)))
+    (native-inputs
+     `(("python-cython" ,python-cython)
+       ("python-distro" ,python-distro)
+       ("python-pytest" ,python-pytest)
+       ("python-setuptools" ,python-setuptools)))
+    (home-page
+     "https://github.com/zulip/python-zulip-api")
+    (synopsis
+     "Zulip's API Python bindings")
+    (description
+     "This package provides Zulip's API Python bindings.")
+    (license license:asl2.0)))
-- 
2.29.2