From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: Re: pypi URL change Date: Mon, 25 Apr 2016 00:26:25 +0200 Message-ID: <571D4811.4050300@gmail.com> References: <571C754A.1050506@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auSU4-0000lJ-WE for guix-devel@gnu.org; Sun, 24 Apr 2016 18:26:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auSU0-0005Qo-04 for guix-devel@gnu.org; Sun, 24 Apr 2016 18:26:32 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:38409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auSTz-0005QB-Ok for guix-devel@gnu.org; Sun, 24 Apr 2016 18:26:27 -0400 Received: by mail-wm0-x233.google.com with SMTP id u206so101072878wme.1 for ; Sun, 24 Apr 2016 15:26:27 -0700 (PDT) Received: from [192.168.0.10] (tal33-3-82-233-82-24.fbx.proxad.net. [82.233.82.24]) by smtp.googlemail.com with ESMTPSA id w82sm13186371wmw.5.2016.04.24.15.26.26 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Apr 2016 15:26:26 -0700 (PDT) In-Reply-To: <571C754A.1050506@gmail.com> 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: guix-devel@gnu.org On 04/24/2016 09:27 AM, Ben Woodcroft wrote: > Hi, > > Today I tried using pypi-url to autogenerate a package that was only > released today. Unfortunately, it seems that the URL scheme has changed > and I was unable to download, though I believe this only affects newly > released package versions. I found this on the nix mailing list: > http://comments.gmane.org/gmane.linux.distributions.nixos/20158 > >> So, previously PyPI used URLs like : >> //packages//{python version}/{name[0]}/{name}/{filename} >> >> Now it uses: >> //packages//{hash[:2]}/{hash[2:4]}/{hash[4:]}/{filename} >> Where hash is blake2b(file_content, digest_size=32).hexdigest().lower() > > Is there a blake2b implemented in Guile? In the meantime, the URL will have to be specified manually: 'guix import pypi ...' provides the correct and updated URL. > The URL should always be correct, because the pypi importer can detect whether the URL build by pypi-uri is wrong (see make-pypi-sexp). Now, in order to handle this new pattern, maybe pypi-uri should: 1) try to compute the "new URI" 2) issue a "curl --head $uri" using some Guile magic 3) return the URI or compute the "old URI" depending on 2) WDYT? Cyril.