GNU bug report logs - #44030
guix import pypi foo@1.2.3 breaks

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: zimoun <zimon.toutoune@HIDDEN>; Keywords: easy; dated Fri, 16 Oct 2020 13:49:01 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 44030 <at> debbugs.gnu.org:


Received: (at 44030) by debbugs.gnu.org; 2 Nov 2020 12:15:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 02 07:15:58 2020
Received: from localhost ([127.0.0.1]:40009 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kZYkg-00084P-De
	for submit <at> debbugs.gnu.org; Mon, 02 Nov 2020 07:15:58 -0500
Received: from mail-wm1-f43.google.com ([209.85.128.43]:55082)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1kZYkf-000847-FJ
 for 44030 <at> debbugs.gnu.org; Mon, 02 Nov 2020 07:15:57 -0500
Received: by mail-wm1-f43.google.com with SMTP id d142so548486wmd.4
 for <44030 <at> debbugs.gnu.org>; Mon, 02 Nov 2020 04:15:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=g1zY2zQKsvVxnmaHCNAKID/8emgsQWifYNtMLoidCe8=;
 b=EZAQUgcs/mXykLWmxepTkhnZTFEVajEJ/h9B2I/5PD+TtU2XxmaLAlx3IB4d70WN6o
 ipBezINST4Fmd4l80bAql1KRqmwj43cdVJ019GDWfGp/g90v5v+WmeB9wAnGm9LV+VHi
 8RpOiYddoT87s/lr5/ekB0r2HyNJ0QGv0uQACeYzVVqa1YOJtNjlHggMgdyyi3JUC2N0
 tU4FAl2/FCdTSEkBQb5iCsp3L1kNpfrctKnrxdjZyVFB/H9EiSqEQKRcmwQ67h8y1bD+
 5NmnJgz7m+odzw/ZsdEG62SFHkvPrJckTSom2xGRXoso310GbkXPs4K77DfCPA4hc/vS
 YugA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=g1zY2zQKsvVxnmaHCNAKID/8emgsQWifYNtMLoidCe8=;
 b=DsdFmxoWMML4/G0irs1/UwQjcoDkfNBlcIPe3WOtcZNDCX5Efmlk4gEtOSv5unClmr
 WKjnxKqiRJwzff0Z9pmhHuahhbq/hB30cCzo2sdEg5FNOGKR8Om23m6nD5l0WeCvtdI4
 C6IVEQfCHu5A896bXYIiR6ElN8o3lgwV45eO3/Mqs5vqYZHV17FLK303ZhmFiCQdJcxd
 ieTb+jcZpbS5U/eIDV3/JbVeGbzbhDd59jEVFFDoai8CBFENByQQTFBRPpcEgmko5xTs
 YW1MYTJNzR0JDQpfTq8V6yhqp7eVwHljx+G6YK3n4RyjXXZbwvlJ2j2DMGSE0lPQdpfl
 BQ4Q==
X-Gm-Message-State: AOAM530m1H8CyXJ/1mfw91lTQ66ASu7x3RoODXXzQidn4ic6Ua4Bo5qj
 M6ZBdSpLNJ6VeUb6/5V5HKi7aXjGcec=
X-Google-Smtp-Source: ABdhPJwa/Siqam1TGe2V1iEGvaE4Jr0WjWdpqkrp6+ez4mHnwBuAJNkOmKb+Z1I880wHRuxwYXsfxw==
X-Received: by 2002:a1c:5401:: with SMTP id i1mr17346822wmb.124.1604319351453; 
 Mon, 02 Nov 2020 04:15:51 -0800 (PST)
Received: from pfiuh02 ([193.48.40.241])
 by smtp.gmail.com with ESMTPSA id d20sm22855769wra.38.2020.11.02.04.15.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 02 Nov 2020 04:15:50 -0800 (PST)
From: zimoun <zimon.toutoune@HIDDEN>
To: Lulu <me@HIDDEN>
Subject: Re: bug#44030: guix import pypi foo@HIDDEN breaks
References: <86wnzqz3h8.fsf@HIDDEN>
 <1958052003.4017.1604009380285@HIDDEN>
Date: Mon, 02 Nov 2020 13:15:50 +0100
In-Reply-To: <1958052003.4017.1604009380285@HIDDEN> (Lulu's
 message of "Fri, 30 Oct 2020 01:09:40 +0300 (TRT)")
Message-ID: <87r1pc54zt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44030
Cc: "44030 <at> debbugs.gnu.org" <44030 <at> debbugs.gnu.org>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Fri, 30 Oct 2020 at 01:09, Lulu <me@HIDDEN> wrote:
> Okay, I tested this a bit and it seems to work fine. I'm going to write f=
ormal
> tests for it (and other importers, if possible) later.

Usually, we try to use the option =E2=80=99--reroll-count=E2=80=99 of git-f=
ormat-patch
for the second (or third or more) version.  It helps the review to know
=E2=80=93 from the subject =E2=80=93 which is the email to read, etc.  Well=
, next
time. :-)


What do you mean by write =E2=80=9Cformal tests=E2=80=9D?


All the best,
simon





Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.

Message received at 44030 <at> debbugs.gnu.org:


Received: (at 44030) by debbugs.gnu.org; 29 Oct 2020 22:09:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 29 18:09:54 2020
Received: from localhost ([127.0.0.1]:55228 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kYG7G-0007GW-3l
	for submit <at> debbugs.gnu.org; Thu, 29 Oct 2020 18:09:54 -0400
Received: from mout-p-102.mailbox.org ([80.241.56.152]:15758)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1kYG7D-0007GG-JA
 for 44030 <at> debbugs.gnu.org; Thu, 29 Oct 2020 18:09:52 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org
 [IPv6:2001:67c:2050:105:465:1:2:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4CMfkK436KzQlWs
 for <44030 <at> debbugs.gnu.org>; Thu, 29 Oct 2020 23:09:45 +0100 (CET)
X-Virus-Scanned: amavisd-new at heinlein-support.de
Received: from smtp2.mailbox.org ([80.241.60.241])
 by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de
 [80.241.56.115]) (amavisd-new, port 10030)
 with ESMTP id KeuvWj99qhRx for <44030 <at> debbugs.gnu.org>;
 Thu, 29 Oct 2020 23:09:41 +0100 (CET)
Date: Fri, 30 Oct 2020 01:09:40 +0300 (TRT)
From: Lulu <me@HIDDEN>
To: "44030 <at> debbugs.gnu.org" <44030 <at> debbugs.gnu.org>
Message-ID: <1958052003.4017.1604009380285@HIDDEN>
Subject: guix import pypi foo@HIDDEN breaks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Priority: 3
Importance: Normal
X-MBO-SPAM-Probability: 
X-Rspamd-Score: -4.90 / 15.00 / 15.00
X-Rspamd-Queue-Id: 961E616FE
X-Rspamd-UID: 143664
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44030
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Okay, I tested this a bit and it seems to work fine. I'm going to write formal
tests for it (and other importers, if possible) later.

--
Lulu




Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Oct 2020 19:32:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 28 15:32:44 2020
Received: from localhost ([127.0.0.1]:50792 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kXrBc-0007AD-G5
	for submit <at> debbugs.gnu.org; Wed, 28 Oct 2020 15:32:44 -0400
Received: from lists.gnu.org ([209.51.188.17]:38238)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1kXrBa-0007A4-38
 for submit <at> debbugs.gnu.org; Wed, 28 Oct 2020 15:32:43 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41354)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1kXrBZ-0004Ka-33
 for guix-patches@HIDDEN; Wed, 28 Oct 2020 15:32:41 -0400
Received: from mout-p-202.mailbox.org ([80.241.56.172]:48488)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1kXrBV-0001bJ-AJ
 for guix-patches@HIDDEN; Wed, 28 Oct 2020 15:32:40 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:105:465:1:1:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4CLzHN0mHKzQlQv
 for <guix-patches@HIDDEN>; Wed, 28 Oct 2020 20:32:32 +0100 (CET)
X-Virus-Scanned: amavisd-new at heinlein-support.de
Received: from smtp1.mailbox.org ([80.241.60.240])
 by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172])
 (amavisd-new, port 10030)
 with ESMTP id gJM05kggzE8O for <guix-patches@HIDDEN>;
 Wed, 28 Oct 2020 20:32:28 +0100 (CET)
Date: Wed, 28 Oct 2020 22:32:27 +0300 (TRT)
From: Lulu <me@HIDDEN>
To: "guix-patches@HIDDEN" <guix-patches@HIDDEN>
Message-ID: <1052540792.123562.1603913548037@HIDDEN>
Subject: [bug#44030] [PATCH] import: pypi: Add '@' syntax for specifying the
 package version.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
Importance: Normal
X-MBO-SPAM-Probability: 
X-Rspamd-Score: -6.19 / 15.00 / 15.00
X-Rspamd-Queue-Id: BD98517E8
X-Rspamd-UID: 746a65
Received-SPF: pass client-ip=80.241.56.172; envelope-from=me@HIDDEN;
 helo=mout-p-202.mailbox.org
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/28 15:32:32
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic] [fuzzy]
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

* guix/import/pypi.scm (pypi-fetch): Add =E2=80=99@=E2=80=99 syntax for spe=
cifying the package version.
---
  guix/import/pypi.scm | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 15116e349d..559be4a98b 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -118,8 +118,10 @@
 =20
  (define (pypi-fetch name)
     "Return a <pypi-project>  record for package NAME, or #f on failure."
-   (and=3D>  (json-fetch (string-append "https://pypi.org/pypi/"  name "/j=
son"))
-             json->pypi-project))
+   ;; Convert @ in package name to / to access the correct URL.
+   (let ((versioned-name (string-join (string-split name #\@) "/")))
+      (and=3D>  (json-fetch (string-append "https://pypi.org/pypi/"  versi=
oned-name "/json"))
+                json->pypi-project)))
 =20
  ;; For packages found on PyPI that lack a source distribution.
  (define-condition-type &missing-source-error &error
--=20
2.29.1




Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.

Message received at 44030 <at> debbugs.gnu.org:


Received: (at 44030) by debbugs.gnu.org; 26 Oct 2020 15:59:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 26 11:59:09 2020
Received: from localhost ([127.0.0.1]:40969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kX4tp-0000HK-Bu
	for submit <at> debbugs.gnu.org; Mon, 26 Oct 2020 11:59:09 -0400
Received: from mail-wm1-f50.google.com ([209.85.128.50]:40197)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1kX4tn-0000Gt-9b
 for 44030 <at> debbugs.gnu.org; Mon, 26 Oct 2020 11:59:07 -0400
Received: by mail-wm1-f50.google.com with SMTP id k18so12995696wmj.5
 for <44030 <at> debbugs.gnu.org>; Mon, 26 Oct 2020 08:59:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:in-reply-to:references:date:message-id:mime-version
 :content-transfer-encoding;
 bh=LDT+F+VKGt2MKBIWTD7BV2VxDX1umE+w4lyMKk/JWZc=;
 b=Yiq9wpnBRmUVSFpA5+59r6Bo9PxFhs33YYlH3MRoSroKXfgpDtxEdiI8u9O8r29jBz
 9qqcNmDdun5LmefoCxN/viXL5kc4gIt0S9ebcb1sQjaa0mw7f9cyXNQllaeYowXwrtbH
 6/mYiG4gEKsACBNK9G+98r6PGedTujB3ICTxLyn8Aw1JBReK2BuAjvQtmLXZ3KpHApvm
 XmcfxdGXGnv+mg2w8sXCHD/QYFcU0YRps3LNcHvX01zzOn/wdcrlMZoTswXmAQ3P6ASr
 HCyOWLD5X88+CkYvHLuawDAow0vGA7tOXBw5ZkTsT98bhc48TtT9CFlhmfZ1SVn/eqnB
 4aew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=LDT+F+VKGt2MKBIWTD7BV2VxDX1umE+w4lyMKk/JWZc=;
 b=reTWPFLh/fXGrdMTnguXjoVhvuwkEjD/zmKpbj/+5JRuaoRtdrT8rpHBCFM53hfEh6
 6p5/7X3k34TIjM39QwO5H7GG3C3vqGAS0kyCjf+5sVCqSjg3Fc25Qbq/t8jAmnLmMx1g
 HHVYn9qFfj4ktQfTk/EpBtYU28+9mx/Hw6DqtIfn2WMC80QP7SVSYwhSLsuLr1aWxd8m
 2ifpF/o72iZEEM2GssaLRWMAOV0VWvPDHO7vOXe272EFPmmn64yV0mgYSPOzxF3R3kEs
 aiOhL2tL9sBsQs3qm4WINHHjLfCLKKAmBhFpE5vJ/avWLJwBI7FWKqEmNZHdih5KO0bB
 b32g==
X-Gm-Message-State: AOAM532gJMZ52qcps0G2QTKaPLfocthP6GFyhYMyKJaLEcnhC76OnSMd
 acj5ibYiWaMzmiLMwA0RzFv/FLTkCAA=
X-Google-Smtp-Source: ABdhPJyRbv1Yk99Z4pkG+nYrW3vpcPOVEO25hyHklJrAp9lNY155MCrkvB6hjTy8UwDxUz2+f9xYUw==
X-Received: by 2002:a1c:e244:: with SMTP id z65mr17375493wmg.40.1603727941171; 
 Mon, 26 Oct 2020 08:59:01 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id l26sm20289358wmi.41.2020.10.26.08.58.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 Oct 2020 08:59:00 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Lulu <me@HIDDEN>, "44030 <at> debbugs.gnu.org" <44030 <at> debbugs.gnu.org>
Subject: Re: bug#44030: guix import pypi foo@HIDDEN breaks
In-Reply-To: <1850369330.68130.1603659032091@HIDDEN>
References: <86wnzqz3h8.fsf@HIDDEN>
 <1850369330.68130.1603659032091@HIDDEN>
Date: Mon, 26 Oct 2020 16:58:58 +0100
Message-ID: <86v9ex3rnh.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 44030
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Sun, 25 Oct 2020 at 23:50, Lulu <me@HIDDEN> wrote:
> I just sent in a patch to fix this for the pypi importer, although
> ideally we'd want versioning support for all importers with a uniform
> syntax.

The uniform syntax is =E2=80=99@=E2=80=99.  However, it is importer by impo=
rter (case by
case) since the external API is different.  AFAIU.


Speaking about =E2=80=9Cguix import pypi=E2=80=9D, the =E2=80=9C--recursive=
=E2=80=9D options still
ungracefully fails; even with you patch.


> I poked and prodded at the RubyGems API to see if it can do what PyPI
> can. It's unfortunately much more limited: API v1 provides a method
> for querying all versions of a gem [1] and v2 provides a method for
> querying specific versions of a gem [2], although neither of them
> provides information about dependency versions, so we can't rely on it
> for recursive imports (since it would try to import latest versions of
> all dependencies). There's a method that fetches dependency and
> versioning info for all versions of all given gems but (probably due
> to the verbosity of JSON/YAML) it's in binary Ruby serialisation
> format [3]. I can try to hack a parser that surgically extracts
> dependency info from a given gem version. What do you think?
>
> ELPA runs into a similar problem in that it provides tarballs/files
> for older versions but dependency info is only provided in the repo
> file. (MELPA tries to directly peg all packages to their respective
> Git repos' trunks.)
>
> I presume it's much simpler with the gnu importer, as it's only a
> matter of pointing the FTP fetch in the right direction, although I
> couldn't confirm it, as the gnu importer doesn't work for me since my
> ISP blocks PGP keyserver ports.
>
> I need to take a closer look at CRAN, CPAN, TeXLive and opam.

Hum?  You are discussing this bug [1], right?  So please could you
discuss overthere.

1: <http://issues.guix.gnu.org/issue/44115>


All the best,
simon




Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Oct 2020 15:49:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 26 11:49:24 2020
Received: from localhost ([127.0.0.1]:40922 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kX4kO-0008Q4-0W
	for submit <at> debbugs.gnu.org; Mon, 26 Oct 2020 11:49:24 -0400
Received: from lists.gnu.org ([209.51.188.17]:48738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1kX4kM-0008Pw-SL
 for submit <at> debbugs.gnu.org; Mon, 26 Oct 2020 11:49:23 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49082)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1kX4kM-0005RW-Ip
 for guix-patches@HIDDEN; Mon, 26 Oct 2020 11:49:22 -0400
Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:54229)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1kX4kK-0003f4-J0
 for guix-patches@HIDDEN; Mon, 26 Oct 2020 11:49:22 -0400
Received: by mail-wm1-x334.google.com with SMTP id d78so12154928wmd.3
 for <guix-patches@HIDDEN>; Mon, 26 Oct 2020 08:49:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:in-reply-to:references:date:message-id:mime-version
 :content-transfer-encoding;
 bh=z42Zja+x1K2spGuOwWSfAaRsqEotgkf0yTWrtZLSbJA=;
 b=JKli0sPAZkVSDR82lydBXE0bzUA08o+s742UwDkPtC9ii3t2DHo3vpb1mYp8Al5sih
 WzCq168IAwoPDiSLHY+9Vljq1JFpkMQmWgDV1/nuKS/ybENS+KnC29uyLfwvayzVJ+CK
 9AH6wUPA5e6MIvhdnEUjHeHELPItGw+flIFyaP5VIFHmQK/xte+2qdbtTjYKKcBkHDSg
 vqVSuwU3ZVTCma6FS0srjWuLrGtqLaUW0ryoPYL7OpjSmh6f0wmr5tJOh+9BwertSK9j
 t7ZlhZ5UJXz28zaE11QWPxh2KW3w8352Ey+WwAFxzYp/dQ6FeEf6zNVyJ3vx7j5XxKxD
 hekQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=z42Zja+x1K2spGuOwWSfAaRsqEotgkf0yTWrtZLSbJA=;
 b=rWBW+S6uK4RuR1U4F7ywcfSLbeNTTPEDg6OyGqcJ3+7/86RNuZVCa4NyHAroVpy8vT
 dUxybqEaMJca0j2MygJbQbTVGq6r4PnouL/CuQJL8xXnu5C+3J/E5rvjEdE+kp/wbAAH
 TcjKO9wIZlC53xiSJ6A3+CfIw9rKkJbJgaFHQrl8oqzM/iBhjpMQuLUUW7cQOg+jiJ1L
 7aEEUpg3kVE89TxLbzWi7/oM6ew62qbcO+xIC0AKM1q15GIh+GR/IrqsQvd9cE3wKDam
 RzD3bsvPL/+1G+4dBTesYItjJSi6VXoESn4pCx/mEnG/Aharym8Li/3iIA5cMSZkKhGm
 x0cQ==
X-Gm-Message-State: AOAM530FYizc4N2Jrpfr5ZlGrUFc1YYutyYu4OkQZBEcF+cLKHw3q3vD
 q7+ucBBOC2nIc7UguJUKJyNFjS8JhmU=
X-Google-Smtp-Source: ABdhPJxdKrtgKQ4iuhy+bTCs6Y52bjTTHVQbCyLVPN0D1egqTo/XyAWsBBMKHSiMumYotpLddnJ2qg==
X-Received: by 2002:a1c:c915:: with SMTP id f21mr8628744wmb.143.1603727358960; 
 Mon, 26 Oct 2020 08:49:18 -0700 (PDT)
Received: from lili ([88.126.110.68])
 by smtp.gmail.com with ESMTPSA id l26sm20251489wmi.41.2020.10.26.08.49.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 Oct 2020 08:49:18 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Lulu <me@HIDDEN>, "guix-patches@HIDDEN" <guix-patches@HIDDEN>
Subject: Re: bug#44030: [PATCH] guix: import: Add versioning syntax to pypi
 importer.
In-Reply-To: <1085530218.67944.1603656272351@HIDDEN>
References: <458803687.67759.1603652981842@HIDDEN>
 <1085530218.67944.1603656272351@HIDDEN>
Date: Mon, 26 Oct 2020 16:49:14 +0100
Message-ID: <86y2jt3s3p.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a00:1450:4864:20::334;
 envelope-from=zimon.toutoune@HIDDEN; helo=mail-wm1-x334.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi,

Thank you for working on this.

On Sun, 25 Oct 2020 at 23:04, Lulu <me@HIDDEN> wrote:
> Ah, heck, I used an old revision of the file when I generated the diff.
> Sorry about that. Here's the properly working patch:

That=E2=80=99s fine.  Usually to ease the reading, it is a good habit to
increase the version of the patch, (see the option =E2=80=99reroll-count=E2=
=80=99 of
git-format-patch).=20


However, the 2 patches are not proper commit, right?  You can locally
commit your changes and send them.  Basically, it means the same thing
but including the commit message.  Here it looks like:

--8<---------------cut here---------------start------------->8---
import: pypi: Allow =E2=80=99@=E2=80=99 for specifying the version.

Fixes <https://bugs.gnu.org/44030>.

* guix/import/pypi.json (pypi-fetch): Allow =E2=80=99@=E2=80=99 for specify=
ing the
  version.
--8<---------------cut here---------------end--------------->8---

Well, I let you find more inspiration in previous commit messages. ;-)


> diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
> index 15116e349d..1ec1ecbfa1 100644
> --- a/guix/import/pypi.scm
> +++ b/guix/import/pypi.scm
> @@ -118,13 +118,15 @@
>=20=20
>  (define (pypi-fetch name)
>    "Return a <pypi-project> record for package NAME, or #f on failure."
> -  (and=3D> (json-fetch (string-append "https://pypi.org/pypi/" name "/js=
on"))
> -         json->pypi-project))
> +  ;; Convert @ in package name to / to access the correct URL.
> +  (let ((versioned-name (string-join (string-split name #\@) "/")))
> +    (and=3D> (json-fetch (string-append "https://pypi.org/pypi/" version=
ed-name "/json"))
> +           json->pypi-project)))

If you feel adventurous, you could try to add a test in the file
=E2=80=9Ctests/pypi.scm=E2=80=9D. :-)

>  ;; For packages found on PyPI that lack a source distribution.
>  (define-condition-type &missing-source-error &error
>    missing-source-error?
> -  (package  missing-source-error-package))
> +  (package missing-source-error-package))

Why is this line modified?


>  (define (latest-source-release pypi-package)
>    "Return the latest source release for PYPI-PACKAGE."
> @@ -371,7 +373,7 @@ be extracted in a temporary directory."
>                   (invoke "tar" "xf" archive "-C" dir)))
>             (let ((requires.txt-files
>                    (find-files dir (lambda (abs-file-name _)
> -		                    (string-match "\\.egg-info/requires.txt$"
> +                                    (string-match "\\.egg-info/requires.=
txt$"

Idem.


All the best,
simon





Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.

Message received at 44030 <at> debbugs.gnu.org:


Received: (at 44030) by debbugs.gnu.org; 25 Oct 2020 23:28:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 25 19:28:47 2020
Received: from localhost ([127.0.0.1]:37941 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kWpRO-00023u-5M
	for submit <at> debbugs.gnu.org; Sun, 25 Oct 2020 19:28:47 -0400
Received: from mout-p-101.mailbox.org ([80.241.56.151]:20218)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1kWmyR-0006ab-Ku
 for 44030 <at> debbugs.gnu.org; Sun, 25 Oct 2020 16:50:44 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:105:465:1:1:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4CK98s2cw0zQl95
 for <44030 <at> debbugs.gnu.org>; Sun, 25 Oct 2020 21:50:37 +0100 (CET)
X-Virus-Scanned: amavisd-new at heinlein-support.de
Received: from smtp1.mailbox.org ([80.241.60.240])
 by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de
 [80.241.56.117]) (amavisd-new, port 10030)
 with ESMTP id m1NgxHA1VhhP for <44030 <at> debbugs.gnu.org>;
 Sun, 25 Oct 2020 21:50:32 +0100 (CET)
Date: Sun, 25 Oct 2020 23:50:32 +0300 (TRT)
From: Lulu <me@HIDDEN>
To: "44030 <at> debbugs.gnu.org" <44030 <at> debbugs.gnu.org>
Message-ID: <1850369330.68130.1603659032091@HIDDEN>
Subject: guix import pypi foo@HIDDEN breaks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Priority: 3
Importance: Normal
X-MBO-SPAM-Probability: 
X-Rspamd-Score: -2.95 / 15.00 / 15.00
X-Rspamd-Queue-Id: 146BF15
X-Rspamd-UID: f822a1
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 44030
X-Mailman-Approved-At: Sun, 25 Oct 2020 19:28:42 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

I just sent in a patch to fix this for the pypi importer, although
ideally we'd want versioning support for all importers with a uniform
syntax.

I poked and prodded at the RubyGems API to see if it can do what PyPI
can. It's unfortunately much more limited: API v1 provides a method
for querying all versions of a gem [1] and v2 provides a method for
querying specific versions of a gem [2], although neither of them
provides information about dependency versions, so we can't rely on it
for recursive imports (since it would try to import latest versions of
all dependencies). There's a method that fetches dependency and
versioning info for all versions of all given gems but (probably due
to the verbosity of JSON/YAML) it's in binary Ruby serialisation
format [3]. I can try to hack a parser that surgically extracts
dependency info from a given gem version. What do you think?

ELPA runs into a similar problem in that it provides tarballs/files
for older versions but dependency info is only provided in the repo
file. (MELPA tries to directly peg all packages to their respective
Git repos' trunks.)

I presume it's much simpler with the gnu importer, as it's only a
matter of pointing the FTP fetch in the right direction, although I
couldn't confirm it, as the gnu importer doesn't work for me since my
ISP blocks PGP keyserver ports.

I need to take a closer look at CRAN, CPAN, TeXLive and opam.

--
Lulu

[1]: https://guides.rubygems.org/rubygems-org-api/#gem-version-methods
[2]: https://guides.rubygems.org/rubygems-org-api-v2/
[3]: https://guides.rubygems.org/rubygems-org-api/#misc-methods




Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Oct 2020 23:28:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 25 19:28:46 2020
Received: from localhost ([127.0.0.1]:37939 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kWpRN-00023n-OI
	for submit <at> debbugs.gnu.org; Sun, 25 Oct 2020 19:28:46 -0400
Received: from lists.gnu.org ([209.51.188.17]:41006)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1kWmFy-0005Rw-NF
 for submit <at> debbugs.gnu.org; Sun, 25 Oct 2020 16:04:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:39464)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1kWmFy-00046x-IY
 for guix-patches@HIDDEN; Sun, 25 Oct 2020 16:04:46 -0400
Received: from mout-p-103.mailbox.org ([2001:67c:2050::465:103]:41248)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1kWmFv-0001NF-SF
 for guix-patches@HIDDEN; Sun, 25 Oct 2020 16:04:45 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org
 [IPv6:2001:67c:2050:105:465:1:2:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4CK87r5RLCzQl1t
 for <guix-patches@HIDDEN>; Sun, 25 Oct 2020 21:04:40 +0100 (CET)
X-Virus-Scanned: amavisd-new at heinlein-support.de
Received: from smtp2.mailbox.org ([80.241.60.241])
 by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de
 [80.241.56.125]) (amavisd-new, port 10030)
 with ESMTP id Sjhc1aI4euQA for <guix-patches@HIDDEN>;
 Sun, 25 Oct 2020 21:04:37 +0100 (CET)
Date: Sun, 25 Oct 2020 23:04:32 +0300 (TRT)
From: Lulu <me@HIDDEN>
To: "guix-patches@HIDDEN" <guix-patches@HIDDEN>
Message-ID: <1085530218.67944.1603656272351@HIDDEN>
In-Reply-To: <458803687.67759.1603652981842@HIDDEN>
References: <458803687.67759.1603652981842@HIDDEN>
Subject: Re: [bug#44030] [PATCH] guix: import: Add versioning syntax to pypi
 importer.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Priority: 3
Importance: Normal
X-MBO-SPAM-Probability: 
X-Rspamd-Score: -6.12 / 15.00 / 15.00
X-Rspamd-Queue-Id: 7629F271
X-Rspamd-UID: da0e94
Received-SPF: pass client-ip=2001:67c:2050::465:103;
 envelope-from=me@HIDDEN; helo=mout-p-103.mailbox.org
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.7 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 25 Oct 2020 19:28:42 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

Ah, heck, I used an old revision of the file when I generated the diff.
Sorry about that. Here's the properly working patch:


diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 15116e349d..1ec1ecbfa1 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -118,13 +118,15 @@
 
 (define (pypi-fetch name)
   "Return a <pypi-project> record for package NAME, or #f on failure."
-  (and=> (json-fetch (string-append "https://pypi.org/pypi/" name "/json"))
-         json->pypi-project))
+  ;; Convert @ in package name to / to access the correct URL.
+  (let ((versioned-name (string-join (string-split name #\@) "/")))
+    (and=> (json-fetch (string-append "https://pypi.org/pypi/" versioned-name "/json"))
+           json->pypi-project)))
 
 ;; For packages found on PyPI that lack a source distribution.
 (define-condition-type &missing-source-error &error
   missing-source-error?
-  (package  missing-source-error-package))
+  (package missing-source-error-package))
 
 (define (latest-source-release pypi-package)
   "Return the latest source release for PYPI-PACKAGE."
@@ -371,7 +373,7 @@ be extracted in a temporary directory."
                  (invoke "tar" "xf" archive "-C" dir)))
            (let ((requires.txt-files
                   (find-files dir (lambda (abs-file-name _)
-		                    (string-match "\\.egg-info/requires.txt$"
+                                    (string-match "\\.egg-info/requires.txt$"
                                                   abs-file-name)))))
              (match requires.txt-files
                (()




Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Oct 2020 23:28:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 25 19:28:45 2020
Received: from localhost ([127.0.0.1]:37937 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kWpRN-00023f-97
	for submit <at> debbugs.gnu.org; Sun, 25 Oct 2020 19:28:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:54682)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1kWlOp-00045p-T0
 for submit <at> debbugs.gnu.org; Sun, 25 Oct 2020 15:09:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58142)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1kWlOp-0002WY-ON
 for guix-patches@HIDDEN; Sun, 25 Oct 2020 15:09:51 -0400
Received: from mout-p-102.mailbox.org ([80.241.56.152]:17982)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1kWlOn-0003eB-5B
 for guix-patches@HIDDEN; Sun, 25 Oct 2020 15:09:50 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org
 [IPv6:2001:67c:2050:105:465:1:2:0])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4CK6wV4LKmzQkKG
 for <guix-patches@HIDDEN>; Sun, 25 Oct 2020 20:09:46 +0100 (CET)
X-Virus-Scanned: amavisd-new at heinlein-support.de
Received: from smtp2.mailbox.org ([80.241.60.241])
 by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173])
 (amavisd-new, port 10030)
 with ESMTP id OR9NaW63XLDV for <guix-patches@HIDDEN>;
 Sun, 25 Oct 2020 20:09:42 +0100 (CET)
Date: Sun, 25 Oct 2020 22:09:41 +0300 (TRT)
From: Lulu <me@HIDDEN>
To: "guix-patches@HIDDEN" <guix-patches@HIDDEN>
Message-ID: <458803687.67759.1603652981842@HIDDEN>
Subject: [bug#44030] [PATCH] guix: import: Add versioning syntax to pypi
 importer.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Priority: 3
Importance: Normal
X-MBO-SPAM-Probability: 
X-Rspamd-Score: -6.04 / 15.00 / 15.00
X-Rspamd-Queue-Id: 63A6C108B
X-Rspamd-UID: a5d512
Received-SPF: pass client-ip=80.241.56.152; envelope-from=me@HIDDEN;
 helo=mout-p-102.mailbox.org
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/25 15:09:46
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic] [fuzzy]
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 25 Oct 2020 19:28:42 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

Use @ as the unified versioning syntax, as per crate and
hackage importers, plus minor spacing fixes.


diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 15116e349d..add2a7ed7a 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -118,13 +118,15 @@
 
 (define (pypi-fetch name)
   "Return a <pypi-project> record for package NAME, or #f on failure."
-  (and=> (json-fetch (string-append "https://pypi.org/pypi/" name "/json"))
-         json->pypi-project))
+  ;; Convert @ in package name to / to access the correct URL.
+  (let ((versioned-name (string-join (string-split name #\@) "/")))
+    (and=> (json-fetch (string-append "https://pypi.org/pypi/" name "/json"))
+           json->pypi-project)))
 
 ;; For packages found on PyPI that lack a source distribution.
 (define-condition-type &missing-source-error &error
   missing-source-error?
-  (package  missing-source-error-package))
+  (package missing-source-error-package))
 
 (define (latest-source-release pypi-package)
   "Return the latest source release for PYPI-PACKAGE."
@@ -371,7 +373,7 @@ be extracted in a temporary directory."
                  (invoke "tar" "xf" archive "-C" dir)))
            (let ((requires.txt-files
                   (find-files dir (lambda (abs-file-name _)
-		                    (string-match "\\.egg-info/requires.txt$"
+                                    (string-match "\\.egg-info/requires.txt$"
                                                   abs-file-name)))))
              (match requires.txt-files
                (()




Information forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.
Added tag(s) easy. Request was from zimoun <zimon.toutoune@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Oct 2020 13:48:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 16 09:48:31 2020
Received: from localhost ([127.0.0.1]:58249 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kTQ5v-0001WP-0Q
	for submit <at> debbugs.gnu.org; Fri, 16 Oct 2020 09:48:31 -0400
Received: from lists.gnu.org ([209.51.188.17]:59320)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1kTQ5t-0001WI-7U
 for submit <at> debbugs.gnu.org; Fri, 16 Oct 2020 09:48:29 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35020)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1kTQ5r-0003UT-Ba
 for bug-guix@HIDDEN; Fri, 16 Oct 2020 09:48:28 -0400
Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:51208)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1kTQ5n-0003UD-LB
 for bug-guix@HIDDEN; Fri, 16 Oct 2020 09:48:26 -0400
Received: by mail-wm1-x334.google.com with SMTP id d81so2576007wmc.1
 for <bug-guix@HIDDEN>; Fri, 16 Oct 2020 06:48:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=wiUhdyW13/mQwaOCJZN+Xhve9a+PCs/pIzV9Rb5ZSRs=;
 b=hWkmf0/lLR30QGHtCceYJP94OhyRaqgHGAGh8uawmtESkVfTWj5Tof6kiqxdqki9pY
 XwA3D3j6DXC7/5xhmao7WauHDHlPUHTvi6H24ABBkXnSdMoeMMbCN89Mg4zKfqFAxVMc
 D4f86laYrMKykDmay2K6pFnXQfCXfzQBfw/N/+RGKiJuROhLyxUMfNtm867DBFJ5nmK7
 ClpofbY/50wMepa/4vhfFCQh7qvlq8eAgI9i/ZplpZgA/cgC/gn7GZWSRsYO7Tz8jMo7
 YCyvrTAZ2S46a0XwywwG6i1Sp9KaSwoOGaDWPccEJokGW6JhGFGOMv5N2VEie2M8WcKO
 EpVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=wiUhdyW13/mQwaOCJZN+Xhve9a+PCs/pIzV9Rb5ZSRs=;
 b=XmMD2oaXEBFJ4/aWFc4dY45tjnHmynzFBFC2aotjdKh4XzzDP/lzcBdy/MQpfbRxlu
 lxVsI/GBp9ZGZ3gWptj7Tche9xwGhNpd4ToTHpDVBlAannh91ly4GmU1Q/2tsS2skUM6
 Zg19qhDvP9MI1xhIGAtbJaRUWCNowNpSAA1jrCQtRYhk51HW+L5elCRjhJG5x33hOke3
 OwH56dGMLBcMLVOj/drGRETDvEPkDOz/+9zGhKtijtDX7DOkP05MurCqfUP9SCWcqO8O
 K3x+83fLMWbk7aGJF4Rb3EYOHEMYbSV/0OqhSyPTc0BuVfiwnrIZB+vMQd5j1lIwVw7O
 RSRQ==
X-Gm-Message-State: AOAM532BSvUa0wnKFMX1zHvixaB0kun/Jv/sR3kNgpPT2OOzKZybA89s
 /53IaoVS0au1NdVu8mogSi20NG7pV1E=
X-Google-Smtp-Source: ABdhPJzygabUsprhVute7YLv55oQeKpi58QVe0kTfGUE2TOn+wGwx+OikKXFPGHwOHpRFC3WWyUyLQ==
X-Received: by 2002:a1c:6355:: with SMTP id x82mr4143804wmb.177.1602856101510; 
 Fri, 16 Oct 2020 06:48:21 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id a5sm3434054wrt.80.2020.10.16.06.48.20
 for <bug-guix@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 16 Oct 2020 06:48:20 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: bug-guix@HIDDEN
Subject: guix import pypi foo@HIDDEN breaks
Date: Fri, 16 Oct 2020 15:48:19 +0200
Message-ID: <86wnzqz3h8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a00:1450:4864:20::334;
 envelope-from=zimon.toutoune@HIDDEN; helo=mail-wm1-x334.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Dear,

The syntax across the different importers are not uniform.  Especially,
compare:

   guix import hackage mtl@HIDDEN
   guix import pypi itsdangerous@HIDDEN

and worse, the option =E2=80=99--recursive=E2=80=99 leads to an error for t=
he latter.
Note that instead:

   guix import pypi itsdangerous/1.1.0

perfectly works, even the option =E2=80=99--recursive=E2=80=99.

All the information is there, and the UI has to be fixed.  It is a
perfect first contribution fixes.


All the best,
simon

PS:
Reported by Zelphir Kaltstahl.
<https://lists.gnu.org/archive/html/help-guix/2020-10/msg00055.html>







Acknowledgement sent to zimoun <zimon.toutoune@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#44030; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 2 Nov 2020 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.