aboutsummaryrefslogtreecommitdiff
path: root/guix/import/pypi.scm
Commit message (Collapse)AuthorAge
* utils: Don’t re-export ‘call-with-temporary-output-file’.Ludovic Courtès2024-04-15
| | | | | | | | | | | | * guix/utils.scm: Remove re-export of ‘call-with-temporary-output-file’. Autoload a number of modules. * guix/download.scm, guix/import/hackage.scm, guix/import/hexpm.scm, guix/import/opam.scm, guix/import/pypi.scm, tests/cpio.scm, tests/egg.scm, tests/opam.scm, tests/publish.scm, tests/store-database.scm, tests/utils.scm: Adjust imports accordingly. Change-Id: I3f5e94631397996a30be2ea4ff8b50a3371e8ee7
* upstream: Replace 'input-changes' field by 'inputs'.Ludovic Courtès2023-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning the expected list of inputs rather than changes relative to the current package definition is less ambiguous and offers more possibilities for further processing. * guix/upstream.scm (<upstream-source>)[input-changes]: Remove. [inputs]: New field. (<upstream-input>): New record type. * guix/upstream.scm (upstream-input-type-predicate) (input-type-filter, upstream-source-regular-inputs) (upstream-source-native-inputs, upstream-source-propagated-inputs): New procedures. (changed-inputs): Expect an <upstream-source> as its second argument. Adjust accordingly. * guix/import/pypi.scm (distribution-sha256): New procedure. (maybe-inputs): Expect a list of <upstream-input>. (compute-inputs): Rewrite to return a list of <upstream-input>. (pypi-package-inputs, pypi-package->upstream-source): New procedures. (make-pypi-sexp): Use it. * guix/import/stackage.scm (latest-lts-release): Define 'cabal'. Replace 'input-changes' field by 'inputs'. * guix/scripts/refresh.scm (update-package): Use 'changed-inputs' instead of 'upstream-source-input-changes'. * tests/cran.scm ("description->package"): Adjust order of inputs. * tests/pypi.scm (default-sha256, default-sha256/base32): New variables. (foo-json): Add 'digests' entry. ("pypi->guix-package, no wheel"): Check HASH against DEFAULT-SHA256/BASE32. ("pypi->guix-package, wheels"): Likewise. ("pypi->guix-package, no usable requirement file."): Likewise. ("pypi->guix-package, package name contains \"-\" followed by digits"): Likewise. ("package-latest-release"): New test. * tests/upstream.scm (test-package-sexp): Remove. ("changed-inputs returns no changes"): Rewrite to use <upstream-source>. (test-new-package-sexp): Remove. ("changed-inputs returns changes to plain input list"): Rewrite. ("changed-inputs returns changes to all plain input lists"): Likewise. ("changed-inputs returns changes to labelled input list") ("changed-inputs returns changes to all labelled input lists"): Remove. * guix/import/cran.scm (maybe-inputs): Expect PACKAGE-INPUTS to be a list of <upstream-input>. (source-dir->dependencies): Return a list of <upstream-input>. (vignette-builders): Likewise. (uri-helper, cran-package-source-url) (cran-package-propagated-inputs, cran-package-inputs): New procedures. (description->package): Use them instead of local definitions. (latest-cran-release): Replace 'input-changes' field by 'inputs'. (latest-bioconductor-release): Likewise. (format-inputs): Remove. * guix/import/hackage.scm (cabal-package-inputs): New procedure. (hackage-module->sexp): Use it. [maybe-inputs]: Expect a list of <upstream-input>.
* tests: pypi: Rewrite tests using a local HTTP server.Ludovic Courtès2023-05-31
| | | | | | | | | | | | | | * guix/import/pypi.scm (%pypi-base-url): New variable. (pypi-fetch): Use it. * tests/pypi.scm (foo-json): Compute URLs relative to '%local-url'. (test-json-1, test-json-2, test-source-hash): Remove. (file-dump): New procedure. (with-pypi): New macro. ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Rewrite using 'with-pypi'.
* import/pypi: Generate packages using pyproject-build-system.Ricardo Wurmus2023-04-29
| | | | | | * guix/import/pypi.scm (make-pypi-sexp): Generate PACKAGE expression where the value for the BUILD-SYSTEM field is PYPROJECT-BUILD-SYSTEM instead of PYTHON-BUILD-SYSTEM.
* guix: Strip #:use-module lists.Ludovic Courtès2023-03-13
| | | | | | | | | | | | This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused.
* import/utils: Pass all arguments through to package builder.Lars-Dominik Braun2022-12-31
| | | | | | | | | | | | | | | | | | | | | | | | | Individual importer may have additional arguments. * guix/import/utils.scm (recursive-import): Patch all keyword arguments through to repo->guix-package. * guix/import/cran.scm (cran->guix-package): Add #:allow-other-keys. * guix/import/crate.scm (crate->guix-package): Ditto. * guix/import/egg.scm (egg->guix-package): Ditto. * guix/import/elm.scm (elm->guix-package): Ditto. * guix/import/gem.scm (gem->guix-package): Ditto. * guix/import/gnu.scm (gnu->guix-package): Ditto. * guix/import/go.scm (go-module->guix-package): Ditto. (go-module-recursive-import): Ditto. * guix/import/hackage.scm (hackage->guix-package): Ditto. (hackage-recursive-import): Ditto. * guix/import/hexpm.scm (hexpm->guix-package): Ditto. * guix/import/minetest.scm (minetest->guix-package): Ditto. (minetest-recursive-import): Ditto. * guix/import/opam.scm (opam->guix-package): Ditto. * guix/import/pypi.scm (pypi->guix-package): Ditto. * guix/import/stackage.scm (stackage->guix-package): Ditto. (stackage-recursive-import): Ditto. * guix/import/texlive.scm (texlive->guix-package): Ditto.
* import: pypi: Allow updating to a specific version.Hartmut Goebel2022-12-26
| | | | | * guix/import/pypi.scm (latest-release): Rename to 'import-release', add #:version argument and pass it on to called functions.
* upstream-updater: Rename record field.Hartmut Goebel2022-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The next commits will make the functions, which are currently importing the latest version of a package, change into importing the latest or a given version of the package (for those updaters supporting specifying a version). Thus the name ‘latest‘ is no longer appropriate. * guix/upstream.scm (upstream-updater) Rename field [latest] to [import]. (lookup-updater, package-latest-release) Adjust fieldname accordingly. * guix/gnu-maintenance.scm (%gnu-updater, %gnu-ftp-updater, %savannah-updater, %sourceforge-updater, %xorg-updater, %kernel.org-updater, %generic-html-updater), guix/import/cpan.scm (%cpan-updater), guix/import/cran.scm (%cran-updater, %bioconductor-updater), guix/import/crate.scm (%crate-updater), guix/import/egg.scm (%egg-updater), guix/import/elpa.scm (%elpa-updater), guix/import/gem.scm (%gem-updater), guix/import/git.scm (%generic-git-updater), guix/import/github.scm (%github-updater), guix/import/gnome.scm (%gnome-updater), guix/import/hackage.scm (%hackage-updater), guix/import/hexpm.scm (%hexpm-updater), guix/import/kde.scm (%kde-updater), guix/import/launchpad.scm (%launchpad-updater), guix/import/minetest.scm (%minetest-updater), guix/import/opam.scm (%opam-updater), guix/import/pypi.scm (%pypi-updater), guix/import/stackage.scm (%stackage-updater), tests/import-github.scm (found-sexp) tests/transformations.scm ("options->transformation, with-latest"): Adjust fieldname accordingly.
* import: pypi: Fix coding style.Hartmut Goebel2022-07-15
| | | | | | | I missed this remark from the review when pushing the last change. * guix/import/pypi.scm(python->package-name): Replace the trailing '#t'-case by a 'else'.
* import: pypi: Add special treatment for Tryton package names,Hartmut Goebel2022-07-15
| | | | | | | | | | | | | | | | | | | | Trytond modules are Python packages, and treated like this in guix. Anyhow, since they are add-ons for the “Trytond“ application, their guix package name do not get the "python-" prefix like other Python modules, (see also https://issues.guix.gnu.org/46057#1). This change disables adding the "python-" prefix to the guix package name for Trytond modules when importing and updating, thus inhibiting irritating messages like in this example: $ guix refresh -u trytond-party … trytond-party: consider adding this propagated input: python-trytond-country trytond-party: consider removing this propagated input: trytond-country Handling this special case seems appropriate since (as of now) there are about 165 packages for Trytond and the number is growing. * guix/import/pypi.scm(python->package-name): Don't add "python-" prefix for trytond packages.
* import: pypi: Use new style for the conditional unzip input.Maxim Cournoyer2022-04-04
| | | | * guix/import/pypi.scm (make-pypi-sexp)<unzip>: Use new style.
* import: pypi: Return multiple values for unknown packages.zimoun2022-03-07
| | | | | | | | | Partly fixes <https://bugs.gnu.org/44115>. * guix/import/pypi.scm (pypi->guix-package): Return two values when PROJECT is false. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* import: pypi: Gracefully handle missing project home page.Ludovic Courtès2022-03-07
| | | | | | | | | Fixes <https://issues.guix.gnu.org/54259>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/import/pypi.scm (pypi->guix-package): Upon 'missing-source-error?', raise '&fix-hint' only if 'project-info-home-page' returns a non-empty string.
* import: pypi: Display a hint upon "no source release" errors.Ludovic Courtès2022-02-02
| | | | | | | Fixes <https://issues.guix.gnu.org/49083>. * guix/import/pypi.scm (pypi->guix-package): Upon 'missing-source-error?', raise a compound condition with a hint.
* import: pypi: Convert hyphens to underscores in PyPI URLs if needed.Vivien Kraus2022-01-26
| | | | | | | | | | | | * guix/import/pypi.scm (find-project-url): New function. (make-pypi-sexp): Use find-project-url. * tests/pypi.scm (foo-json): New procedure. (test-json-1, test-json-2): Define in terms of it. ("find-project-url, with numpy", "find-project-url, uWSGI"): ("find-project-url, flake8-array-spacing") ("find-project-url, foo/goo"): New tests. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* import: Beautify descriptions when appropriate.Xinglu Chen2021-12-17
| | | | | | | | | | | * guix/import/elpa.scm (elpa-package->sexp) * guix/import/gnu.scm (gnu-package->sexp) * guix/import/hackage.scm (hackage-module->sexp) * guix/import/minetest.scm (make-minetest-sexp) * guix/import/opam.scm (opam->guix-package) * guix/import/pypi.scm (make-pypi-sexp): Beautify descriptions. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Merge remote-tracking branch 'origin/master' into core-updates-frozenRicardo Wurmus2021-12-05
|\
| * import: PyPI: Validate GPG signatures when applicable.Marius Bakke2021-12-05
| | | | | | | | | | | | * guix/import/pypi.scm (<distribution>): Fix funny typo. (latest-release): When the distribution has a cryptographic signature, pass it along to UPSTREAM-SOURCE.
* | Merge branch 'master' into core-updates-frozenLudovic Courtès2021-11-17
|\|
| * import: pypi: Allow imports of a specific version.Ludovic Courtès2021-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * guix/import/pypi.scm (latest-version): New procedure. (latest-source-release): Rename to... (source-release): ... this. Add 'version' parameter. (latest-wheel-release): Rename to... (wheel-release): ... this. Add 'version' parameter. (pypi->guix-package): Honor 'version' parameter. (pypi-recursive-import): Add 'version' parameter and honor it. * guix/scripts/import/pypi.scm (guix-import-pypi): Expect a spec. Pass it to 'package-name->name+version'. Pass the 'version' parameter. * tests/pypi.scm ("pypi->guix-package, no wheel"): Exercise the #:version parameter. * doc/guix.texi (Invoking guix import): Document it.
* | Merge remote-tracking branch 'signed/master' into core-updatesMathieu Othacehe2021-10-18
|\|
| * import: pypi: Remove leftover 'pk' call.Ludovic Courtès2021-10-15
| | | | | | | | | | | | | | This is a followup to 7b75f90c5b0da896c486cae23d19d43e2a03bb56. * guix/import/pypi.scm (make-pypi-sexp)[maybe-upstream-name]: Remove leftover 'pk' call.
| * import: pypi: Support 'input-changes'.Xinglu Chen2021-10-15
| | | | | | | | | | | | * guix/import/pypi.scm (latest-release): Specify the ‘input-changes’ field. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* | Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe2021-10-12
|\|
| * import: pypi: Honor the 'upstream-name' package property.Xinglu Chen2021-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | import: pypi: Emit new-style package inputs.Ludovic Courtès2021-07-11
|/ | | | | | | | * guix/import/pypi.scm (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'. (compute-inputs)[requirement->package-name/sort]: Return a list of symbols. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels"): Adjust accordingly.
* import: pypi: Clarify docstring of parse-requires.txtRovanion Luckey2021-04-22
| | | | | | | * guix/import/pypi.scm (parse-requires.txt): Document the parameter more explicitly. Signed-off-by: Leo Famulari <leo@famulari.name>
* import: utils: 'recursive-import' accepts an optional version parameter.Martin Becze2020-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a key VERSION to 'recursive-import' and moves the parameter REPO to a key. This also changes all the places that rely on 'recursive-import'. * guix/import/utils.scm (recursive-import): Add the VERSION key. Make REPO a key. (package->definition): Add optional 'append-version?'. * guix/scripts/import/crate.scm (guix-import-crate): Add the VERSION key. * guix/import/crate.scm (crate->guix-package): Add the VERSION key. (crate-recursive-import): Pass VERSION to recursive-import, remove now unnecessary code. * guix/import/cran.scm (cran->guix-package, cran-recursive-import): Change the REPO parameter to a key. * guix/import/elpa.scm (elpa->guix-package, elpa-recursive-import): Likewise. * guix/import/gem.scm (gem->guix-package, recursive-import): Likewise. * guix/import/opam.scm (opam-recurive-import): Likewise. * guix/import/pypi.scm (pypi-recursive-import): Likewise. * guix/import/stackage.scm (stackage-recursive-import): Likewise. * guix/scripts/import/cran.scm (guix-import-cran): Likewise. * guix/scripts/import/elpa.scm (guix-import-elpa): Likewise. * tests/elpa.scm (eval-test-with-elpa): Likewise. * tests/import-utils.scm (recursive-import): Likewise. Co-authored-by: Hartmut Goebel <h.goebel@crazy-compilers.com>
* Remove (guix json) and require Guile-JSON 4.3.0+.Ludovic Courtès2020-09-08
| | | | | | | | | | | | | | This is a followup to 4071879c86d059ee087c8986915ea72b8c742b72. * guix/json.scm: Remove. * Makefile.am (MODULES): Adjust accordingly. * m4/guix.m4 (GUIX_CHECK_GUILE_JSON): Check for 'define-json-mapping'. * doc/guix.texi (Requirements): Require Guile-JSON 4.3.0+. * guix/ci.scm, guix/cve.scm, guix/import/cpan.scm, guix/import/crate.scm, guix/swh.scm: Remove (guix json) import. * guix/import/gem.scm, guix/import/pypi.scm: Likewise, and import (json). * guix/self.scm (specification->package): Switch to GUILE-JSON-4. * guix/git-download.scm (git-fetch): Likewise.
* utils: Remove compatibility re-export of 'memoize'.Ludovic Courtès2020-07-25
| | | | | | | | | | The 'memoize' binding was re-exported in 2016, commit 19e1d5f7f90194f1ac7e783b28a688ce1441786d, as a backwards-compatibility measure that makes little sense now. * guix/utils.scm: Don't re-export 'memoize'. * guix/import/pypi.scm: Adjust imports. * tests/pypi.scm: Remove duplicate (guix memoization) import.
* import: pypi: Handle 'null instead of #nil.Arun Isaac2020-07-05
| | | | | * guix/import/pypi.scm (non-empty-string-or-false): guile-json now returns 'null instead of #nil for null JSON values. Handle it.
* upstream: Define 'url-predicate' and use it.Ludovic Courtès2020-07-03
| | | | | | | | | | | | | | | * guix/upstream.scm (url-predicate): New procedure. (url-prefix-predicate): Define in terms of 'url-predicate'. * guix/import/cpan.scm (cpan-package?): Use 'url-predicate'. * guix/import/cran.scm (cran-package?) (bioconductor-package?) (bioconductor-data-package?) (bioconductor-experiment-package?): Likewise. * guix/import/crate.scm (crate-package?): Likewise. * guix/import/elpa.scm (package-from-gnu.org?): Likewise. * guix/import/hackage.scm (hackage-package?): Likewise. * guix/import/pypi.scm (pypi-package?): Likewise. * guix/import/gem.scm (gem-package?): Use 'url-prefix-predicate'.
* import: pypi: Rewrite to use 'define-json-mapping'.Ludovic Courtès2020-03-12
| | | | | | | | | | * 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.
* import: pypi: Add more licensesLars-Dominik Braun2020-03-04
| | | | | | | * guix/import/pypi.scm (string->license): Add the BSD 2-clause and MPL 2.0 licenses, and add more strings for BSD 3-clause and Expat license. Signed-off-by: Leo Famulari <leo@famulari.name>
* import: pypi: Support exporting packages with .zip source.Jakub Kądziołka2020-02-05
| | | | | | | | | * guix/import/pypi.scm (make-pypi-sexp): Rename test-inputs to native-inputs. Restructure the way pypi-uri parameters are generated. Use pypi-uri's extension parameter when required. Add "unzip" to native inputs when the package source is a zip file. Signed-off-by: Marius Bakke <mbakke@fastmail.com>
* import: pypi: Refresher recognizes pythonhosted.org source URLs.Ludovic Courtès2019-09-18
| | | | | | | | | | This is a followup to a5376200541abf8245973e601be246bf65b8b6c7. Since that commit, 'pypi-package?' would return false for most Python packages, and thus "guix refresh python-xxx" would report that no updaters apply to the package. * guix/import/pypi.scm (pypi-package?)[pypi-url?]: Recognize "files.pythonhosted.org" URLs.
* maint: Switch to Guile-JSON 3.x.Ludovic Courtès2019-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guile-JSON 3.x is incompatible with Guile-JSON 1.x, which we relied on until now: it maps JSON dictionaries to alists (instead of hash tables), and JSON arrays to vectors (instead of lists). This commit is about adjusting all the existing code to this new mapping. * m4/guix.m4 (GUIX_CHECK_GUILE_JSON): New macro. * configure.ac: Use it. * doc/guix.texi (Requirements): Mention the Guile-JSON version. * guix/git-download.scm (git-fetch)[guile-json]: Use GUILE-JSON-3. * guix/import/cpan.scm (string->license): Expect vectors instead of lists. (module->dist-name): Use 'json-fetch' instead of 'json-fetch-alist'. (cpan-fetch): Likewise. * guix/import/crate.scm (crate-fetch): Likewise, and call 'vector->list' for DEPS. * guix/import/gem.scm (rubygems-fetch): Likewise. * guix/import/json.scm (json-fetch-alist): Remove. * guix/import/pypi.scm (pypi-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (latest-source-release, latest-wheel-release): Call 'vector->list' on RELEASES. * guix/import/stackage.scm (stackage-lts-info-fetch): Use 'json-fetch' instead of 'json-fetch-alist'. (lts-package-version): Use 'vector->list'. * guix/import/utils.scm (hash-table->alist): Remove. (alist->package): Pass 'vector->list' on the inputs fields, and default to the empty vector. * guix/scripts/import/json.scm (guix-import-json): Remove call to 'hash-table->alist'. * guix/swh.scm (define-json-reader): Expect pair? or null? instead of hash-table?. [extract-field]: Use 'assoc-ref' instead of 'hash-ref'. (json->branches): Use 'map' instead of 'hash-map->list'. (json->checksums): Likewise. (json->directory-entries, origin-visits): Call 'vector->list' on the result of 'json->scm'. * tests/import-utils.scm ("alist->package with dependencies"): New test. * gnu/installer.scm (build-compiled-file)[builder]: Use GUILE-JSON-3. * gnu/installer.scm (installer-program)[installer-builder]: Likewise. * gnu/installer/locale.scm (iso639->iso639-languages): Use 'assoc-ref' instead of 'hash-ref', and pass vectors through 'vector->list'. (iso3166->iso3166-territories): Likewise. * gnu/system/vm.scm (system-docker-image)[build]: Use GUILE-JSON-3. * guix/docker.scm (manifest, config): Adjust for Guile-JSON 3. * guix/scripts/pack.scm (docker-image)[build]: Use GUILE-JSON-3. * guix/import/github.scm (fetch-releases-or-tags): Update docstring. (latest-released-version): Use 'assoc-ref' instead of 'hash-ref'. Pass the result of 'fetch-releases-or-tags' to 'vector->list'. * guix/import/launchpad.scm (latest-released-version): Likewise.
* import: pypi: Preserve package name case when forming pypi-uri.Maxim Cournoyer2019-07-02
| | | | | | | | | Fixes <https://bugs.gnu.org/33046>. * guix/build-system/python.scm (pypi-uri): Update the host URI to "files.pythonhosted.org". * guix/import/pypi.scm (make-pypi-sexp): Preserve the package name case when the source URL calls for it.
* import: pypi: Include optional test inputs as native-inputs.Maxim Cournoyer2019-07-02
| | | | | | | | | | | | | | | | | | | | | | * guix/import/pypi.scm (maybe-inputs): Add INPUT-TYPE argument, and use it. (test-section?): New predicate. (parse-requires.txt): Collect the optional test inputs, and return them as the second element of the returned list. (parse-wheel-metadata): Likewise. (guess-requirements): Adapt. (make-pypi-sexp): Likewise, and include the test inputs requirements as native inputs in the returned package expression. * tests/pypi.scm (test-requires.txt): Include a test section in the test-requires.txt data. (test-requires.txt-beaker): New variable. ("parse-requires.txt"): Adapt. ("parse-requires.txt - Beaker"): New test. ("parse-wheel-metadata, with extras"): Adapt. ("parse-wheel-metadata, with extras - Jedi"): Adapt. ("pypi->guix-package, no wheel"): Re-indent, and add the expected native-inputs. ("pypi->guix-package, wheels"): Likewise.
* import: pypi: Completely mute the output of the "unzip" command.Maxim Cournoyer2019-07-02
| | | | | * guix/import/pypi.scm (guess-requirements): Completely mute the output of the "unzip" command.
* import: pypi: Fix typo in docstring.Maxim Cournoyer2019-07-02
| | | | * guix/import/pypi.scm (guess-requirements): Fix typo.
* import: pypi: Parse wheel METADATA instead of metadata.json.Maxim Cournoyer2019-07-02
| | | | | | | | | | | | | With newer Wheel releases, there is no more metadata.json file; the METADATA file should be used instead (see: https://github.com/pypa/wheel/issues/195). This change updates our PyPI importer so that it uses the latter. * guix/import/pypi.scm (define-module): Remove unnecessary modules and export the PARSE-WHEEL-METADATA procedure. (parse-wheel-metadata): Add procedure. (guess-requirements): Use it. * tests/pypi.scm (test-metadata): Test it.
* import: pypi: Support more types of archives.Maxim Cournoyer2019-07-02
| | | | | | | | | | | | | | | | | | This change enables the PyPI importer to look for requirements in a source archive of a different type than "tar.gz" or "tar.bz2". Also, scan the source archive to find a requires.txt file. * guix/import/pypi.scm: (guess-requirements)[tarball-directory]: Remove procedure. [guess-requirements-from-source]: Use COMRESSED-FILE? to determine if an archive type is supported, and some file extension logic that chooses either "tar" or "unzip" as the extractor. Search for the requires.txt file in the archive instead of using a static, expected location. (guess-requirements): Rename the TARBALL argument to ARCHIVE, to denote the archive format is no longer bound specifically to the Tar format. (compute-inputs): Likewise. * tests/pypi.scm ("pypi->guix-package, no wheel"): Mock the requires.txt at a non-standard location. ("pypi->guix-package, no usable requirement file."): New test.
* import: pypi: Deduplicate requirements.Maxim Cournoyer2019-07-02
| | | | * guix/import/pypi.scm (parse-requires.txt): Remove potential duplicates.
* import: pypi: Improve parsing of requirement specifications.Maxim Cournoyer2019-07-02
| | | | | | | | | | | | | | | The previous solution was fragile and could leave unwanted characters in a requirement name, such as '[' or ']'. Partially fixes <https://bugs.gnu.org/33047>. * guix/import/pypi.scm (use-modules): Export SPECIFICATION->REQUIREMENT-NAME (%requirement-name-regexp): New variable. (clean-requirement): Rename to... (specification->requirement-name): this, which now uses %requirement-name-regexp to select the requirement name from the requirement specification. (parse-requires.txt): Adapt.
* import: pypi: Do not parse optional requirements from source.Maxim Cournoyer2019-07-02
| | | | | | | | | | | | | | * guix/import/pypi.scm: Export PARSE-REQUIRES.TXT. (clean-requirement): Move procedure to the top level. (guess-requirements): Move the READ-REQUIREMENTS procedure to the top level, and rename it to PARSE-REQUIRES.TXT. Move the CLEAN-REQUIREMENT procedure to the top level. Move the COMMENT? functions inside the PARSE-REQUIRES.TXT procedure. (parse-requires.txt): Add a SECTION-HEADER? predicate, and use it to prevent parsing optional requirements. * tests/pypi.scm (test-requires-with-sections): New variable. ("parse-requires.txt, with sections"): New test.
* import: pypi: Do not consider requirements.txt files.Maxim Cournoyer2019-07-02
| | | | | | | | | | | | | | | | | | PyPI packages are mandated to have a setup.py file, which contains a listing of the required dependencies. The setuptools/distutils machinery embed metadata in the archives they produce, which contains this information. There is no need nor gain to collect the requirements from a "requirements.txt" file, as it is not the true record of dependencies for PyPI packages and may contain extraneous requirements or not exist at all. * guix/import/pypi.scm (guess-requirements): Update comment. [guess-requirements-from-source]: Do not attempt to parse the file requirements.txt. Streamline logic. * tests/pypi.scm (test-requires.txt): Rename from test-requirements, to hint at the file being tested. ("pypi->guix-package"): Adapt so that the fake package contains a requires.txt file rather than a requirements.txt file. ("pypi->guix-package, wheels"): Likewise.
* gnu: Use pypi.org.Leo Famulari2018-10-18
| | | | | | | | <pypi.io> redirects to <pypi.org>. * guix/build-system/python.scm (pypi-uri): Replace pypi.io with pypi.org. * guix/import/pypi.scm (pypi-url?): Likewise. * tests/pypi.scm: Likewise.
* import: pypi: Support recursive importing.Ricardo Wurmus2018-08-30
| | | | | | | | | | | | * guix/import/pypi.scm (guess-requirements): Use upstream names. (compute-inputs): Return the upstream dependency names as an additional value. (make-pypi-sexp): Likewise. (pypi->guix-package): Memoize it. (pypi-recursive-import): New procedure. * guix/scripts/import/pypi.scm (show-help, %options): Accept "recursive" option. (guix-import-pypi): Use pypi-recursive-import. * doc/guix.texi (Invoking guix import): Document it.
* import: pypi: Also guess dependencies from *.egg-info/requires.txt.Ricardo Wurmus2018-08-30
| | | | | | * guix/import/pypi.scm (guess-requirements): Extract "requires.txt" from the egg-info directory in addition to "requirements.txt"; strip off version constraints; use call-with-temporary-directory.