Hi,
Xinglu Chen <public@yoctocell.xyz> writes:
Toggle quote (30 lines)
> 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.
In my opinion, if a package contains wrong values in their metadata,
it's a problem that should be reported to that package. As with other
things, garbage in -> garbage out; Guix cannot do much here. I seem to
recall that some older PyPI mirror had that problem. It may be that
their metadata name -> URI is not consistent. We could try to find what
that 2nd scheme is and attempt both, although that's not very elegant
and it probably points to packages being very outdated to start with.
Thanks,
Maxim