From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 26 11:49:24 2020 Received: (at submit) by debbugs.gnu.org; 26 Oct 2020 15:49:24 +0000 Received: from localhost ([127.0.0.1]:40922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX4kO-0008Q4-0W for submit@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 ) id 1kX4kM-0008Pw-SL for submit@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 ) id 1kX4kM-0005RW-Ip for guix-patches@gnu.org; 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 ) id 1kX4kK-0003f4-J0 for guix-patches@gnu.org; Mon, 26 Oct 2020 11:49:22 -0400 Received: by mail-wm1-x334.google.com with SMTP id d78so12154928wmd.3 for ; 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 To: Lulu , "guix-patches@gnu.org" Subject: Re: bug#44030: [PATCH] guix: import: Add versioning syntax to pypi importer. In-Reply-To: <1085530218.67944.1603656272351@office.mailbox.org> References: <458803687.67759.1603652981842@office.mailbox.org> <1085530218.67944.1603656272351@office.mailbox.org> Date: Mon, 26 Oct 2020 16:49:14 +0100 Message-ID: <86y2jt3s3p.fsf@gmail.com> 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@gmail.com; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, Thank you for working on this. On Sun, 25 Oct 2020 at 23:04, Lulu 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 . * 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 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