import: pypi: Rewrite to use 'define-json-mapping'.

* guix/import/pypi.scm (non-empty-string-or-false): New procedure.
(<pypi-project>, <project-info>, <distribution>): New record types.
(pypi-fetch): Call 'json->pypi-project'.
(latest-source-release, latest-wheel-release): Use the new record
accessors instead of 'assoc-ref*'.
(pypi->guix-package, latest-release): Likewise.
* tests/pypi.scm (test-json): Add mandatory fields.
This commit is contained in:
Ludovic Courtès 2020-03-12 11:04:00 +01:00
parent a20cfe71e9
commit 7657e61d6b
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 95 additions and 29 deletions

View file

@ -38,7 +38,10 @@
\"license\": \"GNU LGPL\",
\"summary\": \"summary\",
\"home_page\": \"http://example.com\",
\"classifiers\": [],
\"download_url\": \"\"
},
\"urls\": [],
\"releases\": {
\"1.0.0\": [
{