unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleg Pykhalov <go.wigust@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 30305@debbugs.gnu.org
Subject: [bug#30305] [PATCH] gnu: Add python-send2trash.
Date: Fri, 09 Feb 2018 23:21:00 +0300	[thread overview]
Message-ID: <87vaf5vrrn.fsf@gmail.com> (raw)
In-Reply-To: <87o9l25eg0.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 06 Feb 2018 16:24:15 +0100")


[-- Attachment #1.1: Type: text/plain, Size: 753 bytes --]

Hello Ludovic,

Thank you for review!

ludo@gnu.org (Ludovic Courtès) writes:

  > Oleg Pykhalov <go.wigust@gmail.com> skribis:
 
  >> +    (synopsis "Send file to trash")
  >> +    (description
  >> +     "This package provides a Python library to send files to the trash.")
 
  > Perhaps in the description you can add more details as to what “the
  > trash” is (is it ~/Trash, or what?).

Yes, “~/Trash”.

  > Is there a reason for not providing a Python 2.x variant?  If there is
  > one, please add a comment.

Yes, I had an issue to build it with Python 2 because tests failed.
Solved in the new attached patch.
 
  > OK with these changes, thank you!

The new synopsis, description and builded with Python 2.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: New synopsis, description and builded with Python 2 --]
[-- Type: text/x-patch, Size: 2353 bytes --]

From b4327af5b9c72c107b9764addd4b409a3a2cb351 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Wed, 31 Jan 2018 16:27:33 +0300
Subject: [PATCH] gnu: Add python-send2trash.

* gnu/packages/python.scm (python-send2trash): New public variable.
---
 gnu/packages/python.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 777590b58..85547ac5a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -12394,6 +12394,47 @@ 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 Trash directory")
+    (description "This package provides a Python library to send files to the
+user's 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))))))))
+
 (define-public python-yapf
   (package
     (name "python-yapf")
-- 
2.15.1


[-- Attachment #1.3: Type: text/plain, Size: 15 bytes --]


Thanks,
Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-02-09 20:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 13:28 [bug#30305] [PATCH] gnu: Add python-send2trash Oleg Pykhalov
2018-02-06 15:24 ` Ludovic Courtès
2018-02-09 20:21   ` Oleg Pykhalov [this message]
2018-02-09 22:03     ` Ludovic Courtès
2018-02-10  8:46       ` Oleg Pykhalov
2018-06-22 19:47 ` [bug#30305] " Gábor Boskovits
2018-06-23 16:52   ` bug#30305: " Oleg Pykhalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vaf5vrrn.fsf@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=30305@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).