summary refs log tree commit diff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2017-01-18 08:53:02 +0100
committerDanny Milosavljevic <dannym@scratchpost.org>2017-01-19 15:34:46 +0100
commitd83d87225980cec4926aec03280ad3533b778281 (patch)
tree719660c81d5f9bdda17b204fa1a74eebf655021a /gnu/packages/python.scm
parentb585e361844e0ab527d10880698ee0489347b1c6 (diff)
downloadguix-d83d87225980cec4926aec03280ad3533b778281.tar.gz
gnu: Add python-dulwich.
* gnu/packages/python.scm (python-dulwich, python2-dulwich): New variables.
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm46
1 files changed, 46 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b0601da4db..7c4996ce4b 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12734,3 +12734,49 @@ Features:
 @item Compiles templates into optimized, yet readable, Python code.
 @end enumerate")
     (license (license:x11-style "file://LICENSE"))))
+
+(define-public python-dulwich
+  (package
+    (name "python-dulwich")
+    (version "0.16.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (list (string-append "https://www.dulwich.io/releases/"
+                            "dulwich-" version ".tar.gz")
+                   (pypi-uri "dulwich" version)))
+        (sha256
+          (base32 "0fl47vzfgc3w3rmhn8naii905cjqcp0vc68iyvymxp7567hh6als"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'fix-tests
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; The tests use Popen with a custom environment which doesn't
+             ;; include PATH.
+             (substitute* "dulwich/tests/compat/utils.py"
+               (("'git'") (string-append "'"
+                                         (which "git")
+                                         "'")))
+             (substitute* '("dulwich/tests/test_repository.py"
+                            "dulwich/tests/test_hooks.py")
+               (("#!/bin/sh") (string-append "#!" (which "sh"))))
+             (setenv "TEST_RUNNER" "unittest")
+             (setenv "PYTHONHASHSEED" "random")
+             #t)))))
+    (propagated-inputs
+     `(("python-fastimport" ,python-fastimport)))
+    (native-inputs
+     `(("python-mock" ,python-mock)
+       ("python-geventhttpclient" ,python-geventhttpclient)
+       ("git" ,git)))
+    (home-page "https://www.dulwich.io/")
+    (synopsis "Git implementation in Python")
+    (description "Dulwich is an implementation of the Git file formats and
+protocols written in pure Python.")
+    ;; Can be used with either license.
+    (license (list license:asl2.0 license:gpl2+))))
+
+(define-public python2-dulwich
+  (package-with-python2 python-dulwich))