all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: 47746@debbugs.gnu.org
Subject: bug#47746: pypi importer generates wrong pypi-uri without underscore
Date: Wed, 14 Apr 2021 14:45:11 +0200	[thread overview]
Message-ID: <871rbdhw6g.fsf@yoctocell.xyz> (raw)
In-Reply-To: <87h7k9uanf.fsf@elephly.net>

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

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?


[-- Attachment #2: fix-pypi-uri --]
[-- Type: text/x-patch, Size: 1918 bytes --]

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	other threads:[~2021-04-14 12:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13  8:17 bug#47746: pypi importer generates wrong pypi-uri without underscore Ricardo Wurmus
2021-04-13 18:54 ` Xinglu Chen
2021-04-13 21:39   ` Ricardo Wurmus
2021-04-14 12:45     ` Xinglu Chen [this message]
2021-04-19  2:37       ` Maxim Cournoyer

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rbdhw6g.fsf@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=47746@debbugs.gnu.org \
    --cc=rekado@elephly.net \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.