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: 29847@debbugs.gnu.org
Subject: [bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source
Date: Sun, 01 Apr 2018 16:26:38 +0300	[thread overview]
Message-ID: <87zi2nnjld.fsf@gmail.com> (raw)
In-Reply-To: <87605fvx6i.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 29 Mar 2018 15:16:53 +0200")

[-- Attachment #1: Type: text/plain, Size: 1676 bytes --]

Hello Ludovic,

Apologies for a long reply.

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

> Ping!
>
> ludo@gnu.org (Ludovic Courtès) skribis:
>
>> OK for the patch, but please simply replace ‘leave’ with ‘warning’.

I think the patch is no longer needed, because ‘pypi->guix-package’
returns false (‘#f’) and REPL survives if a package doesn't exist:
--8<---------------cut here---------------start------------->8---
scheme@(guix import pypi)> (pypi->guix-package "psutil")

Starting download of /tmp/guix-file.9Q8PGN
From https://pypi.python.org/packages/e2/e1/600326635f97fee89bf8426fef14c5c29f4849c79f68fd79f433d8c1bd96/psutil-5.4.3.tar.gz...
 …4.3.tar.gz  403KiB                  1.6MiB/s 00:00 [##################] 100.0%

Starting download of /tmp/guix-file.Vn9nDZ
From https://pypi.python.org/packages/e5/cc/6dd427e738a8db6d0b66525856da43d2ef12c4c19269863927f7cf0e2aaf/psutil-5.4.3-cp27-none-win32.whl...
 …7-none-win32.whl  216KiB            1.3MiB/s 00:00 [##################] 100.0%
$3 = (package (name "python-psutil") #; more fields here)
scheme@(guix import pypi)> (pypi->guix-package "psutils") ; ‘psutils’ doesn't exist in ‘pypi’
$4 = #f
--8<---------------cut here---------------end--------------->8---

WDYT?

> Note that at the REPL you can always do:
>
>   (catch 'quit (lambda () …) (const #f))

Thank you!  Based on this I wrote a macro:

   (define-macro (try function)
    `(catch 'quit (lambda () ,function) (const #f)))

but I don't know how to make it available after invoking ‘guile’ in
Bash.  Putting the macro in ‘~/.guile’ doesn't help unfortunately.

Thanks,
Oleg.

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

  reply	other threads:[~2018-04-01 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-25 13:46 [bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source Oleg Pykhalov
2017-12-25 13:59 ` ng0
2017-12-25 15:55   ` Oleg Pykhalov
2017-12-25 19:38     ` ng0
2017-12-29 11:14 ` Danny Milosavljevic
2018-01-11 21:39 ` Ludovic Courtès
2018-03-29 13:16   ` Ludovic Courtès
2018-04-01 13:26     ` Oleg Pykhalov [this message]
2018-04-02 16:16       ` bug#29847: " Ludovic Courtès

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=87zi2nnjld.fsf@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=29847@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).