summary refs log tree commit diff
diff options
context:
space:
mode:
authorOleg Pykhalov <go.wigust@gmail.com>2018-01-31 16:27:33 +0300
committerOleg Pykhalov <go.wigust@gmail.com>2018-06-23 19:49:11 +0300
commit02e2d18297c9352d5f12abe128a82e579d9be278 (patch)
tree1ac6223522bccb4c07701a9f02115c0343e90736
parent2cf2c778846153f3d5a56e98232fbef6f71b57a6 (diff)
downloadguix-02e2d18297c9352d5f12abe128a82e579d9be278.tar.gz
gnu: Add python-send2trash.
* gnu/packages/python.scm (python-send2trash, python2-send2trash): New public
variables.
-rw-r--r--gnu/packages/python.scm42
1 files changed, 42 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 7bb918605c..08894239c2 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12886,6 +12886,48 @@ and works only with Python 2 and NumPy < 1.9.")
 (define-public python2-phonenumbers
   (package-with-python2 python-phonenumbers))
 
+(define-public python-send2trash
+  (package
+    (name "python-send2trash")
+    (version "1.4.2")
+    (source
+     (origin (method url-fetch)
+             ;; Source tarball on PyPI doesn't include tests.
+             (uri (string-append "https://github.com/hsoft/send2trash/archive/"
+                                 version ".tar.gz"))
+             (file-name (string-append name "-" version ".tar.gz"))
+             (sha256
+              (base32
+               "0ffyhwjyx61slkdy38iwjc4gmj7fj9gs2q58f075gwvq630pzm9z"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'pre-check
+           (lambda _
+             (mkdir-p "/tmp/foo")
+             (setenv "HOME" "/tmp/foo")
+             #t)))))
+    (home-page "https://github.com/hsoft/send2trash")
+    (synopsis "Send files to the user's @file{~/Trash} directory")
+    (description "This package provides a Python library to send files to the
+user's @file{~/Trash} directory.")
+    (license license:bsd-3)))
+
+(define-public python2-send2trash
+  (package
+    (inherit (package-with-python2 python-send2trash))
+    (arguments
+     (substitute-keyword-arguments (package-arguments python-send2trash)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-before 'check 'setenv
+             (lambda _
+               (setenv "PYTHONPATH"
+                       (string-append (getcwd) ":" (getenv "PYTHONPATH")))
+               #t))))))
+    (properties `((python2-variant . ,(delay python-send2trash))))))
+
 (define-public python-yapf
   (package
     (name "python-yapf")