From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IDu9I+OKll9sUAAA0tVLHw (envelope-from ) for ; Mon, 26 Oct 2020 08:37:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eBWcH+OKll+OfAAAB5/wlQ (envelope-from ) for ; Mon, 26 Oct 2020 08:37:55 +0000 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 05062940416 for ; Mon, 26 Oct 2020 08:37:54 +0000 (UTC) Received: from localhost ([::1]:38696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWy0m-0006q7-UT for larch@yhetil.org; Mon, 26 Oct 2020 04:37:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWpRf-0005bF-Sy for bug-guix@gnu.org; Sun, 25 Oct 2020 19:29:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWpRf-0002xk-Jy for bug-guix@gnu.org; Sun, 25 Oct 2020 19:29:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWpRf-00024x-H3 for bug-guix@gnu.org; Sun, 25 Oct 2020 19:29:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44030: [PATCH] guix: import: Add versioning syntax to pypi importer. References: <86wnzqz3h8.fsf@gmail.com> In-Reply-To: <86wnzqz3h8.fsf@gmail.com> Resent-From: Lulu Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 25 Oct 2020 23:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44030 X-GNU-PR-Package: guix X-GNU-PR-Keywords: easy To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.16036685257926 (code B ref -1); Sun, 25 Oct 2020 23:29:03 +0000 Received: (at submit) by debbugs.gnu.org; 25 Oct 2020 23:28:45 +0000 Received: from localhost ([127.0.0.1]:37937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWpRN-00023f-97 for submit@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 ) id 1kWlOp-00045p-T0 for submit@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 ) id 1kWlOp-0002WY-ON for guix-patches@gnu.org; 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 ) id 1kWlOn-0003eB-5B for guix-patches@gnu.org; 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 ; 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 ; Sun, 25 Oct 2020 20:09:42 +0100 (CET) Date: Sun, 25 Oct 2020 22:09:41 +0300 (TRT) From: Lulu Message-ID: <458803687.67759.1603652981842@office.mailbox.org> 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@erkin.party; 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-Mailman-Approved-At: Sun, 25 Oct 2020 19:28:42 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.7 (--) X-Mailman-Approved-At: Mon, 26 Oct 2020 04:35:21 -0400 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: hktPr2TJDIlC 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 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 (()