diff mbox series

[bug#51222,18/25] gnu: Add python-janus.

Message ID 20211015024036.53831-18-sl@eauchat.org
State Accepted
Headers show
Series Package python-pantalaimon | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Sébastien Lerique Oct. 15, 2021, 2:40 a.m. UTC
* gnu/packages/python-xyz.scm (python-janus): New variable.
---
 gnu/packages/python-xyz.scm | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 02e605b16d..5f80a39fc0 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -269,6 +269,45 @@  The purpose of this package is to provide an easy way to test asynchronous
 HTTP requests.")
     (license license:expat)))
 
+(define-public python-janus
+  (package
+    (name "python-janus")
+    (version "0.6.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "janus" version))
+       (sha256
+        (base32 "030xvl2vghi5ispfalhvch1rl6i2jsy5bf1dgjafa7vifppy04j7"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "pytest" "--cov=janus" "--cov=tests")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-cov" ,python-pytest-cov)
+       ("python-pytest-asyncio" ,python-pytest-asyncio)))
+    (home-page "https://github.com/aio-libs/janus/")
+    (synopsis
+     "Sync-async queue to interoperate between asyncio tasks and classic threads")
+    (description
+     "Mixed sync-async queue, supposed to be used for communicating between
+classic synchronous (threaded) code and asynchronous (in terms of
+@url{https://docs.python.org/3/library/asyncio.html,asyncio}) one.  Like
+@url{https://en.wikipedia.org/wiki/Janus,Janus god} the queue object from the
+library has two faces: synchronous and asynchronous interface.  Synchronous is
+fully compatible with
+@url{https://docs.python.org/3/library/queue.html,standard queue},
+asynchronous one follows
+@url{https://docs.python.org/3/library/asyncio-queue.html,asyncio queue
+design}.")
+    (license license:asl2.0)))
+
 (define-public python-ueberzug
   (package
     (name "python-ueberzug")