[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#57460] [PATCH v3 15/18] import: pypi: Allow updating to a specific
From: |
Hartmut Goebel |
Subject: |
[bug#57460] [PATCH v3 15/18] import: pypi: Allow updating to a specific version. |
Date: |
Tue, 20 Dec 2022 10:34:20 +0100 |
* guix/import/pypi.scm (latest-release): Rename to 'import-release',
add #:version argument and pass it on to called functions.
---
guix/import/pypi.scm | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 3e3e949283..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?)
- (import latest-release)))
+ (import import-release)))
--
2.30.6
- [bug#57460] [PATCH v3 13/18] import: kde: Allow updating to a specific version., (continued)
- [bug#57460] [PATCH v3 13/18] import: kde: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 17/18] upstream: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 18/18] doc: Describe how to update to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 03/18] import: Issue error-message if version is given., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 10/18] import: github: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 12/18] import: hexpm: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 09/18] import: git: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 14/18] import: launchpad: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 16/18] refresh: Allow updating to a specific version., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH v3 15/18] import: pypi: Allow updating to a specific version.,
Hartmut Goebel <=
- [bug#57460] [PATCH v3 04/18] import: sourceforge: Issue error-message if version is given., Hartmut Goebel, 2022/12/20
- [bug#57460] [PATCH 00/19] Refresh to specific version, Ludovic Courtès, 2022/12/23