summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-03-07 22:06:28 +0100
committerLudovic Courtès <ludo@gnu.org>2022-03-07 22:49:28 +0100
commitebb03447f8cc93b9e070b3e7706d7a64d5d1772c (patch)
tree16c9726dc63608cb3e5b0fdc60366ee113814e6f
parentad464b1704d21ef59c91c1ab6935af4b34efd5c5 (diff)
downloadguix-patches-ebb03447f8cc93b9e070b3e7706d7a64d5d1772c.tar
guix-patches-ebb03447f8cc93b9e070b3e7706d7a64d5d1772c.tar.gz
import: pypi: Gracefully handle missing project home page.
Fixes <https://issues.guix.gnu.org/54259>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/import/pypi.scm (pypi->guix-package): Upon 'missing-source-error?', raise '&fix-hint' only if 'project-info-home-page' returns a non-empty string.
-rw-r--r--guix/import/pypi.scm17
1 files changed, 10 insertions, 7 deletions
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index e07b792c53..edfca3454b 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -500,19 +500,22 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
(guard (c ((missing-source-error? c)
(let ((package (missing-source-error-package c)))
(raise
- (make-compound-condition
+ (apply
+ make-compound-condition
(formatted-message
(G_ "no source release for pypi package ~a ~a~%")
(project-info-name info) version)
- (condition
- (&fix-hint
- (hint (format #f (G_ "This indicates that the
+ (match (project-info-home-page info)
+ ((or #f "") '())
+ (url
+ (list
+ (condition
+ (&fix-hint
+ (hint (format #f (G_ "This indicates that the
package is available on PyPI, but only as a \"wheel\" containing binaries, not
source. To build it from source, refer to the upstream repository at
@uref{~a}.")
- (or (project-info-home-page info)
- (project-info-url info)
- "?"))))))))))
+ url))))))))))))
(make-pypi-sexp (project-info-name info) version
(and=> (source-release project version)
distribution-url)