From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WEViLctrC2PvdgEAbAwnHQ (envelope-from ) for ; Sun, 28 Aug 2022 15:21:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IBh4LMtrC2OL3QAAG6o9tA (envelope-from ) for ; Sun, 28 Aug 2022 15:21:15 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6350423CA9 for ; Sun, 28 Aug 2022 15:21:15 +0200 (CEST) Received: from localhost ([::1]:58550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSIDx-00052s-JO for larch@yhetil.org; Sun, 28 Aug 2022 09:21:13 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661692875; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=nXDlsJFF+OBmoS+vB0C45fl+3lg3qjvSVyRvHnkCb74=; b=jGNXn5JeauK8Gqot1YrsA01ZjFQqTF6DDHRC+GH7S75R3R1jDVDOxVn47vHvn/sDY0zGBA ulvNeDBQmjENdfvlfNyro/ii3U3TxKvttMl9DpWWvKLxONlRsW4ovw+5M9A0PWNKDU8k84 UNEaJz/irKi8auVEjm24l0LP1rbDTScHD7SDOBCZ6umFn9z7zBN+jdgYORVJSp1A0vjwTv YorCWTwIEAw5SDiSKpiGxxzSJU2QwBv0HVYUc27+FoweeTIN5IIqADBB/C/O4CC7zeNbOG kYZYlS2PDRZxrFjKK3Qp141Qt5TTNTxual1LGnKW2CspEWPJDsFnP/0Da4GxcA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661692875; a=rsa-sha256; cv=none; b=iQg98y6Bd+8lzFdmjkzXKjbMI2UYLvLHOhmaNFIA7v2GTpwvQlNEDiHH4eoq2npxtr9OqP dQUQonij9N4xXyIVuDzwnVvpOkquAebmRKU4ufU7iRbl9Zw0/hG3Whxb7UmuTOTdmQOFTa wRR6f5SpHWlxKcg42zMEc4NNWgY++6mb63ymNOSlxJPEWqaSAehiNuafVess6FoXOkepgr HNDRr03kiloyzRufscf6L4iWHzmZZ+Zl1HW8PpuUoHnFHbY8Vb4ENeF2p/wY0KP76Sn6f4 gGnOWvrHOg1GdmUqG+ZSU1Yms8mJoHpxTNkuc90FPfEn0tzHJr0XSVOQ4UEdlw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.80 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6350423CA9 X-Spam-Score: -0.80 X-Migadu-Scanner: scn0.migadu.com X-TUID: wZNgVi2UGuu7 * 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))) -- 2.30.4