guix-play/guix/import
Xinglu Chen 7b75f90c5b
import: pypi: Honor the 'upstream-name' package property.
Previously, when a PyPI package had a “-” followed by one or more digits in
its name, e.g., “AV-98”, the importer would interpret “98” as the version of
the package and thus mistake the “AV-98” package for the “av” package on PyPI.

  $ ./pre-inst-env guix refresh av-98
  following redirection to `https://pypi.org/pypi/av/json'...
  /home/yoctocell/src/guix/gnu/packages/web-browsers.scm:914:13: av-98 would be upgraded from 1.0.1 to 8.0.3

Setting the ‘upstream-name’ property to “AV-98” would solve the problem.

  $ ./pre-inst-env guix refresh av-98
  /home/yoctocell/src/guix/gnu/packages/web-browsers.scm:914:13: 1.0.1 is already the latest version of av-98

* guix/import/pypi.scm (guix-package->pypi-name): Honor ‘upstream-name’
property.
(make-pypi-sexp): Set ‘upstream-name’ property when appropriate.
* tests/pypi.scm (test-json): Rename to ...
(test-json-1): ... this.
(test-json-2): New variable
("guix-package->pypi-name, honor 'upstream-name'"): New test.
("pypi->guix-package, package name contains \"-\" followed by digits"):
Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-30 23:44:49 +02:00
..
cabal.scm import: cabal: Treat identifier names correctly. 2021-09-15 14:28:38 +02:00
cpan.scm import, swh: Adjust to Guile-JSON 4.5.x unspecified value handling. 2021-01-21 00:14:38 +01:00
cran.scm guix: Update to Bioconductor 3.13. 2021-06-05 09:12:39 +02:00
crate.scm import: crate: Use repository when home-page is unavailable 2021-02-12 22:47:09 +01:00
egg.scm build-system: chicken: Add 'egg-uri' procedure. 2021-08-30 14:38:50 +02:00
elpa.scm import: elpa: Don't hardcode default branch to 'master'. 2021-09-10 17:30:55 +02:00
gem.scm import, swh: Adjust to Guile-JSON 4.5.x unspecified value handling. 2021-01-21 00:14:38 +01:00
git.scm import: Add 'generic-git' updater. 2021-09-18 19:37:45 +02:00
github.scm import: github: Gracefully handle projects that have disappeared. 2020-07-24 14:21:30 +02:00
gnome.scm import: gnome: Silence URL redirect messages. 2021-03-17 23:10:19 +01:00
gnu.scm import: gnu: Fix the detection of non-GNU packages. 2021-02-02 13:48:35 -05:00
go.scm import: go: Match "go-import" meta tags anywhere. 2021-09-18 23:08:32 +02:00
hackage.scm import: hackage: Prefix licenses with 'license:'. 2021-05-22 23:39:27 +02:00
json.scm import/json: json->code: Handle files with more than one definition. 2020-04-16 23:41:52 +02:00
kde.scm import: KDE updater finds packages even in sub-directory. 2019-09-10 19:04:06 +02:00
launchpad.scm import: launchpad: Fix typo. 2021-06-19 22:21:47 +02:00
minetest.scm import: minetest: Fix typos. 2021-09-28 22:00:47 +02:00
opam.scm guix: opam: More flexibility in the importer. 2021-08-21 00:05:21 +02:00
print.scm import/print: package->code: Fix license object. 2021-07-19 19:57:51 +02:00
pypi.scm import: pypi: Honor the 'upstream-name' package property. 2021-09-30 23:44:49 +02:00
stackage.scm import: stackage: Don’t try to update packages not available on Stackage. 2021-09-27 13:37:51 +02:00
texlive.scm import: texlive: Produce a partial package definition rather than crashing. 2021-01-10 23:30:30 -05:00
utils.scm import: utils: Skip not found packages. 2021-09-01 23:41:42 +02:00