import: pypi: Rewrite to use 'define-json-mapping'.
authorLudovic Courtès <ludo@gnu.org>
Thu, 12 Mar 2020 10:04:00 +0000 (11:04 +0100)
committerLudovic Courtès <ludo@gnu.org>
Thu, 12 Mar 2020 10:52:37 +0000 (11:52 +0100)
commit7657e61d6b33fe758fd69355ed53efbd5310743c
tree548d01dbd7c126a2970660032995f7f390c86d4d
parenta20cfe71e9cd9450e9cfbe9e4bc478a0c726a2af
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.
guix/import/pypi.scm
tests/pypi.scm