diff options
| author | Marius Bakke <marius@gnu.org> | 2022-12-28 01:02:47 +0100 |
|---|---|---|
| committer | Marius Bakke <marius@gnu.org> | 2022-12-28 01:02:47 +0100 |
| commit | ec0fbb471dfc6f72796da9ebafbb0630daa91267 (patch) | |
| tree | 3b42f3d0a6470d85fbb8421179634bb278883e4e /guix/import/pypi.scm | |
| parent | f5ef7d34e4deecb80aff585c108b0a2ab1f33ce4 (diff) | |
| parent | 0cb8f7125b19264b01962c1249c3df4c5ce85aa9 (diff) | |
Merge branch 'master' into staging
Diffstat (limited to 'guix/import/pypi.scm')
| -rw-r--r-- | guix/import/pypi.scm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 4760fc3dae..0e5998b36e 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2021 Marius Bakke <marius@gnu.org> ;;; Copyright © 2022 Vivien Kraus <vivien@planete-kraus.eu> ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com> +;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -556,15 +557,16 @@ source. To build it from source, refer to the upstream repository at (string-prefix? "https://pypi.org/packages" url) (string-prefix? "https://files.pythonhosted.org/packages" url))))) -(define (latest-release package) - "Return an <upstream-source> for the latest release of PACKAGE." +(define* (import-release package #:key (version #f)) + "Return an <upstream-source> for the latest release of PACKAGE. Optionally +include a VERSION string to fetch a specific version." (let* ((pypi-name (guix-package->pypi-name package)) (pypi-package (pypi-fetch pypi-name))) (and pypi-package (guard (c ((missing-source-error? c) #f)) (let* ((info (pypi-project-info pypi-package)) - (version (project-info-version info)) - (dist (source-release pypi-package)) + (version (or version (project-info-version info))) + (dist (source-release pypi-package version)) (url (distribution-url dist))) (upstream-source (urls (list url)) @@ -574,7 +576,7 @@ source. To build it from source, refer to the upstream repository at #f)) (input-changes (changed-inputs package - (pypi->guix-package pypi-name))) + (pypi->guix-package pypi-name #:version version))) (package (package-name package)) (version version))))))) @@ -583,4 +585,4 @@ source. To build it from source, refer to the upstream repository at (name 'pypi) (description "Updater for PyPI packages") (pred pypi-package?) - (latest latest-release))) + (import import-release))) |
