bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#47746: pypi importer generates wrong pypi-uri without underscore


From: Xinglu Chen
Subject: bug#47746: pypi importer generates wrong pypi-uri without underscore
Date: Wed, 14 Apr 2021 14:45:11 +0200

On Tue, Apr 13 2021, Ricardo Wurmus wrote:

> You’re right, this only affects some packages.  Here are two 
> examples:
>
> [...]
>
> They both have a redirection in common, but the pypi-uri is 
> incorrect as it needs to have the underscore.

Looking at the JSON object at
<https://pypi.org/pypi/jupyterlab-widgets/json>, it specifies
“jupyterlabs-widgets” as ‘info.downloads.name’, which is what the PyPi
importer reads to determine the PyPi URI.

Would it make sense to just make it read the name that the user
specifies in the shell, i.e. ‘./pre-inst-env guix import pypi
PACKAGE-NAME’ (see the patch below)?  Or will this potentially mess up
other PyPi URIs?

>From ec5612e9d4c2026541874c6a3eaf7c9009ce4a31 Mon Sep 17 00:00:00 2001
Message-Id: 
<ec5612e9d4c2026541874c6a3eaf7c9009ce4a31.1618404153.git.public@yoctocell.xyz>
From: Xinglu Chen <public@yoctocell.xyz>
Date: Wed, 14 Apr 2021 14:37:01 +0200
Subject: [PATCH] import: pypi: Use package name from the shell to construct
 the URI.

Some packages will list an incorrect package name in the JSON object,
resulting in PyPi URIs that lead to nowhere.

* guix/import/pypi.scm (pypi->guix-package): Use the package name specified in
the shell (guix import pypi PACKAGE-NAME) to construct the PyPi URI.

Fixes <https://issues.guix.gnu.org/47746>.
Reported by Ricardo Wurmus <rekado@elephly.net>.
---
 guix/import/pypi.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index bf4dc50138..be9470ad26 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
 ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -483,7 +484,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and 
LICENSE."
                          (leave (G_ "no source release for pypi package ~a 
~a~%")
                                 (project-info-name info)
                                 (project-info-version info)))))
-              (make-pypi-sexp (project-info-name info)
+              (make-pypi-sexp package-name
                               (project-info-version info)
                               (and=> (latest-source-release project)
                                      distribution-url)

base-commit: 82543e9649da2da9a5285ede4ec4f718fd740fcb
-- 
2.31.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]