import: pypi: do not fail when 'run_requires' is missing from the metadata.

* guix/import/pypi.scm (read-wheel-metadata): do not crash when 'run_requires'
is missing from the metadata.
This commit is contained in:
Cyril Roelandt 2016-06-17 14:11:08 +02:00
parent ea92ae01c2
commit aebd383d04
1 changed files with 4 additions and 2 deletions

View File

@ -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)))))