[1/3] gnu: Add python-tblib and python2-tblib

Message ID 1464541235-12826-2-git-send-email-h.goebel@crazy-compilers.com
State New
Headers

Commit Message

Hartmut Goebel May 29, 2016, 5 p.m. UTC
  * packages/python.scm (python-tblib) (python2-tblib): New
  variables.
---
 gnu/packages/python.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
  

Comments

Ludovic Courtès June 1, 2016, 8:31 p.m. UTC | #1
Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> * packages/python.scm (python-tblib) (python2-tblib): New
>   variables.

Applied with cosmetic changes, thanks.

Ludo’.
  

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index dc54bff..96163cf 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -19,6 +19,7 @@ 
 ;;; Copyright © 2015, 2016 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
+;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -8788,3 +8789,45 @@  the renaming, moving and extracting of attributes, functions, modules, fields
 and parameters in Python 2 source code.  These refactorings can also be applied
 to occurences in strings and comments.")
     (license gpl2)))
+
+(define-public python-tblib
+  (package
+    (name "python-tblib")
+    (version "1.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "tblib" version))
+       (sha256 (base32
+         "02iahfkfa927hb4jq2bak36ldihwapzacfiq5lyxg8llwn98a1yi"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+        (replace 'check
+         (lambda _
+           ; Upstream runs tests after installation and the package itself
+           ; resides in a subdirectory. Extend PYTHONPATH so it will be found.
+           (setenv "PYTHONPATH"
+                   (string-append (getcwd) "/build/lib:" (getenv "PYTHONPATH")))
+           (zero? (system* "py.test" "-vv" "tests" "README.rst")))))))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-setuptools" ,python-setuptools)
+       ("python-six" ,python-six)))
+    (home-page "https://github.com/ionelmc/python-tblib")
+    (synopsis "Traceback serialization library")
+    (description
+     "Traceback serialization allows you to:
+
+@itemize
+@item Pickle tracebacks and raise exceptions with pickled tracebacks in
+different processes. This allows better error handling when running code over
+multiple processes (imagine multiprocessing, billiard, futures, celery etc).
+
+@item Parse traceback strings and raise with the parsed tracebacks.
+@end itemize")
+    (license bsd-3)))
+
+(define-public python2-tblib
+  (package-with-python2 python-tblib))