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

From: Ricardo Wurmus <[email-masked]>
Date: Tue, 13 Apr 2021 23:39:32 +0200

Xinglu Chen <[email-masked]> writes:

> On Tue, Apr 13 2021, Ricardo Wurmus wrote:
>
>> When importing a package from Pypi whose name includes an 
>> underscore, the importer will generate a pypi-uri expression 
>> where 
>> the underscore has been replaced with a dash.
>
> Hmm, I just grabbed a random package from PyPi, and the URI 
> seems fine
> to me. […]
> How would I reproduce the bug?

You’re right, this only affects some packages.  Here are two 
examples:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix import pypi -r jupyterlab_widgets
following redirection to 
`https://pypi.org/pypi/jupyterlab-widgets/json'...
[…] (uri (pypi-uri "jupyterlab-widgets" version)) […]
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix import pypi -r jupyter_packaging
following redirection to 
`https://pypi.org/pypi/jupyter-packaging/json'...
[…] (uri (pypi-uri "jupyter-packaging" version)) […]
--8<---------------cut here---------------end--------------->8---

They both have a redirection in common, but the pypi-uri is 
incorrect as it needs to have the underscore.

-- 
Ricardo