From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH]: guix: python-build-system: Change pypi-uri to use https://pypi.io. Date: Fri, 24 Jun 2016 14:14:27 +0200 Message-ID: <87ziqa6axo.fsf@gnu.org> References: <87inx1t6l6.fsf@dustycloud.org> <20160622185036.GA13667@jasmine> <87shw4i16t.fsf_-_@member.fsf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGQ0K-0006W8-RF for guix-devel@gnu.org; Fri, 24 Jun 2016 08:14:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGQ0F-0006EK-Qp for guix-devel@gnu.org; Fri, 24 Jun 2016 08:14:35 -0400 In-Reply-To: <87shw4i16t.fsf_-_@member.fsf.org> (=?utf-8?B?IuWui+aWhw==?= =?utf-8?B?5q2mIidz?= message of "Thu, 23 Jun 2016 19:39:38 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: =?utf-8?B?5a6L5paH5q2m?= Cc: guix-devel iyzsong@member.fsf.org (=E5=AE=8B=E6=96=87=E6=AD=A6) skribis: > Leo Famulari writes: > >> On Wed, Jun 22, 2016 at 01:35:17PM -0500, Christopher Allan Webber wrote: >>> Note that the old URL scheme no longer seemed to work. >>>=20 >>> I'm not thrilled by the new URL "scheme". It seems like more work to >>> update with each version bump. I'm not sure what the solution is? >> >> Please review Ben's 'pypi-origin' patch :) >> >> http://lists.gnu.org/archive/html/guix-devel/2016-06/msg00724.html >> >>> (source (origin >>> (method url-fetch) >>> - (uri (pypi-uri "Flask" version)) >>> + (uri >>> + (string-append >>> + "https://pypi.python.org/packages/55/8a/" >>> + "78e165d30f0c8bb5d57c429a30ee5749825ed461ad6c959688872= 643ffb3/" >>> + "Flask-0.11.1.tar.gz")) >> >> In the meantime, I think it's best to keep the hash on its own line, to >> reduce noise in the commit log if we do more updates in this format. > > Ah, nixpkgs use pypi.io for it, and it will redirect the old uri > scheme to the new one. > > I guess we should do the same? Sounds simple and efficient. :-) The problem with the =E2=80=98pypi-origin=E2=80=99 macro that Ben proposed = is that it would force us to maintain two hashes (SHA1 and SHA256) per package, which is annoying. > From 4605399da016c11314e8d4aef84f7007f82f8d75 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?=3DE5=3DAE=3D8B=3DE6=3D96=3D87=3DE6=3DAD=3DA6?=3D > Date: Thu, 23 Jun 2016 19:23:28 +0800 > Subject: [PATCH] guix: python-build-system: Change pypi-uri to use > https://pypi.io. > > * guix/build-system/python.scm (pypi-uri): Use https://pypi.io. > * gnu/packages/python.scm (python-twisted)[uri]: Remove https://pypi.io. > --- > gnu/packages/python.scm | 5 +---- > guix/build-system/python.scm | 2 +- > 2 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm > index 4567a91..8c34ff2 100644 > --- a/gnu/packages/python.scm > +++ b/gnu/packages/python.scm > @@ -9097,10 +9097,7 @@ to provide a high-level synchronous API on top of = the libev event loop.") > (version "16.2.0") > (source (origin > (method url-fetch) > - (uri (list (pypi-uri "Twisted" version ".tar.bz2") ; 404 > - (string-append > - "https://pypi.io/packages/source/T/Twisted/" > - "Twisted-" version ".tar.bz2"))) > + (uri (pypi-uri "Twisted" version ".tar.bz2")) > (sha256 > (base32 > "0ydxrp9myw1mvsz3qfzx5579y5llmqa82pxvqchgp5syczffi450"))= )) > diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm > index c3d6c62..705943e 100644 > --- a/guix/build-system/python.scm > +++ b/guix/build-system/python.scm > @@ -48,7 +48,7 @@ > "Return a URI string for the Python package hosted on the Python Packa= ge > Index (PyPI) corresponding to NAME and VERSION. EXTENSION is the file n= ame > extension, such as '.tar.gz'." > - (string-append "https://pypi.python.org/packages/source/" > + (string-append "https://pypi.io/packages/source/" > (string-take name 1) "/" name "/" > name "-" version extension)) LGTM! Also, if pypi.python.org is now content-addressed, we could add a =E2=80=98pypi-fetch=E2=80=99 method based on =E2=80=98uri-fetch=E2=80=99, b= ut with an additional content-addressed mirror. Thoughts? Thanks, Ludo=E2=80=99.