guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

13/23: pypi:


From: guix-commits
Subject: 13/23: pypi:
Date: Mon, 4 Jul 2022 09:49:23 -0400 (EDT)

htgoebel pushed a commit to branch wip-import-version
in repository guix.

commit 7acd6f842e6e9e4131569d787c740c3ead010042
Author: Hartmut Goebel <h.goebel@crazy-compilers.com>
AuthorDate: Fri Jun 24 22:31:10 2022 +0200

    pypi:
    
    latest-release: kw-arg version, this argument overrules the version from
    projekt-info. Pass version onto source-release.
---
 guix/import/pypi.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 392fc9700b..130ec769b3 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.
 ;;;
@@ -554,15 +555,15 @@ 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)
+(define* (latest-release package #:key (version #f))
   "Return an <upstream-source> for the latest release of PACKAGE."
   (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))
@@ -572,7 +573,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)))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]