unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Cyril Roelandt <tipecaml@gmail.com>
To: 23780@debbugs.gnu.org
Subject: bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata.
Date: Fri, 17 Jun 2016 14:43:55 +0200	[thread overview]
Message-ID: <1466167435-10265-1-git-send-email-tipecaml@gmail.com> (raw)
In-Reply-To: <20160617061639.666c57c6@scratchpost.org>

* guix/import/pypi.scm (read-wheel-metadata): do not crash when 'run_requires'
is missing from the metadata.
---
 guix/import/pypi.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 70ef507..f08d948 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -175,8 +175,10 @@ cannot determine package dependencies"))
                  (lambda (port)
                    (let* ((metadata (json->scm port))
                           (run_requires (hash-ref metadata "run_requires"))
-                          (requirements (hash-ref (list-ref run_requires 0)
-                                                  "requires")))
+                          (requirements (if run_requires
+                                          (hash-ref (list-ref run_requires 0)
+                                                     "requires")
+                                          '())))
                      (map (lambda (r)
                             (python->package-name (clean-requirement r)))
                           requirements)))))
-- 
2.6.2

  parent reply	other threads:[~2016-06-17 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17  4:16 bug#23780: guix import pypi jedi: weird backtrace, no proper error message Danny Milosavljevic
2016-06-17  4:41 ` Ben Woodcroft
2016-06-17 11:31   ` Danny Milosavljevic
2016-06-17 11:55     ` Cyril Roelandt
2016-06-17 12:43 ` Cyril Roelandt [this message]
2016-06-17 15:09   ` bug#23780: [PATCH] import: pypi: do not fail when 'run_requires' is missing from the metadata Ludovic Courtès
2016-06-28 21:11     ` 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=1466167435-10265-1-git-send-email-tipecaml@gmail.com \
    --to=tipecaml@gmail.com \
    --cc=23780@debbugs.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).