From patchwork Sun Aug 28 13:18:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 42034 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C733B27BBEA; Sun, 28 Aug 2022 14:21:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6226427BBE9 for ; Sun, 28 Aug 2022 14:21:13 +0100 (BST) Received: from localhost ([::1]:58550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSIDw-00052s-IH for patchwork@mira.cbaines.net; Sun, 28 Aug 2022 09:21:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSICv-0002xp-Fp for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSICv-0002g1-65 for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSICv-0006z6-2K for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57460] [PATCH 14/20] refresh: Allow updating to a specific version (pypi) Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Aug 2022 13:20:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57460 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57460@debbugs.gnu.org Received: via spool by 57460-submit@debbugs.gnu.org id=B57460.166169278126679 (code B ref 57460); Sun, 28 Aug 2022 13:20:09 +0000 Received: (at 57460) by debbugs.gnu.org; 28 Aug 2022 13:19:41 +0000 Received: from localhost ([127.0.0.1]:57802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSICS-0006w9-El for submit@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:40 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:42361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSICF-0006uf-F8 for 57460@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:28 -0400 Received: from hermia.goebel-consult.de ([46.87.137.46]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Moewz-1pCKG03SxN-00p2TP for <57460@debbugs.gnu.org>; Sun, 28 Aug 2022 15:19:21 +0200 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 4151165A47; Sun, 28 Aug 2022 15:18:56 +0200 (CEST) From: Hartmut Goebel Date: Sun, 28 Aug 2022 15:18:40 +0200 Message-Id: X-Mailer: git-send-email 2.30.4 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:+gTz6KGT+7cvLoGgqJOz/vjRacYbZUjg36DnATmMV/ZD/2d4wPI /GiBklPlYl3mIqfvLhxD0WUDRF4EMToyWBBrOoXIBK6KykcLuXQAQX5nCszFSpQY9YFyYef LZvDPphk2xODaL/yCB0PpYIfRPwApBMFEgC9CYsUmcJy4wb+GZz8BAjYCtdveKvgzvGNYA8 3jFlu7X1qTqp4av5n7cvQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:QYTumhzo3kw=:4NC9q5szv10vKx7NMxsj1u hgIAz9CGMaFjJyVw9mbKDqSU9dJbZJDkdryjmOhSa59fExleVm/ye4Gq0+WcCF7/Y2tI3zBE3 XcpXoi13+TYFiJ9UB+CLZehY1tSg9SQLOKXvFWLwcMSa5KjB8k06Hs9Kb3g7I5nL51P+xwwXB 7LAGZIGoR835GVyN4H5CdV6QCw7GgP+lVsd3CZbrHUuNYwiUJ8RQcvrPDNlVm9bjLPwzgGkR7 RZr8PX50RENvC/V8hkqD5TgCIEhlIUSqn/rAsdRG8XuiEyECpHbodXCYOycldBzvfEvy5MXAH i0T5ivBRyDztkUVccKRDoUAtbx4585dnz+cNFm07GUktYwt9kUFXYEpIFVeHuyws9TZFdEiGM DHqFh5M58yyqFVrjSRtkTa28i3O5ODphocB361f5FyBdrWX0Bp1HGzQ+g1Cb9rSVeLaZMbtml /nalYNLIl4aMdjim8sbYBLtkIxLhy1y1IziRa/40Hbp96cefGkt9tyQmmLNjYBA5IyOr2H3HX B/BL5aFsZjtz/Ra71lywAFZQpQnjYRdWNqQpva65SU6PAj+vIcjdCeDQuUugcknPy9lkhXQ5S GT1bY8KFQgw6UpJi1KPx/f1E1RKveaWBtieUnM55tklDPvdEuWHN7Xov2H+FJLdH3X8YLa5P6 sZF+Gt7tRWG44P4skiIpWru8RQYPEkf85ie3SqgVVK1y+SMjItqgJllhDzrWr6UPCJDbICL7e 9YO/9UA/NRCEwhTzc9Fr3ZWc8qqH6zsUI7juH0T7O1c9KwPeN5c9ocf6jj0= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/import/pypi.scm(latest-release): Rename to (import-release), add keyword-argument 'version' and pass it on to called functions. --- guix/import/pypi.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 3e3e949283..1ab48de71b 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2021 Marius Bakke ;;; Copyright © 2022 Vivien Kraus ;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -556,15 +557,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* (import-release package #:key (version #f)) "Return an 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)) @@ -574,7 +575,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 +584,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)))