From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] import: Add PyPI importer. Date: Mon, 29 Sep 2014 09:04:53 +0200 Message-ID: <87r3yu29gq.fsf@gnu.org> References: <8761g8ojde.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87eguwentt.fsf@gnu.org> <8738bbmhln.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> 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]:47254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYV14-0002IS-Ul for guix-devel@gnu.org; Mon, 29 Sep 2014 03:05:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYV10-0005Qm-6I for guix-devel@gnu.org; Mon, 29 Sep 2014 03:05:02 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:40835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYV0z-0005Qc-VI for guix-devel@gnu.org; Mon, 29 Sep 2014 03:04:58 -0400 In-Reply-To: <8738bbmhln.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Sun, 28 Sep 2014 19:48:52 -0400") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel@gnu.org David Thompson skribis: > Ludovic Court=C3=A8s writes: > >> I wonder if there may be shared options between all the importers >> (like an option for import & live build.) >> >> That can still be addressed by exporting an option list from (guix >> scripts import), like (guix scripts build) does, I think. >> > > Done. Added an empty options list for now. To avoid circular > dependencies, I had to lazily resolve the importer procedures in > guix/scripts/import.scm. Yes, and it=E2=80=99s probably a good idea to do like this anyway, so that = (guix scripts import) doesn=E2=80=99t really have to know about the existing importers. [...] >>> +(define (make-pypi-sexp name version source-url home-page synopsis >>> + description license) >>> + "Return the `package' s-expression for a python package with the giv= en NAME, >> >> Namely, what do you think of having importers return directly a >> =E2=80=98package=E2=80=99 object? Then there could be a shared =E2=80= =98package->sexp=E2=80=99 >> procedure, that would to the fancy =E2=80=98string-append=E2=80=99 thing= like above. >> >> And, eventually, we can add an option to do live builds of the generated >> package objects. >> >> That can also be done in the next iteration, though. >> > > I think this is best saved for another patch since it involves modifying > the snix code. I agree that it is a good idea. OK. >>> +(define (factorize-uri uri version) >>> + "Factorize URI, a package tarball URI as a string, such that any occ= urrences >>> +of the string VERSION is replaced by the symbol 'version." >> >> This one from snix is redundant with =E2=80=98tarball-url->string-append= =E2=80=99 (and >> maybe less sophisticated?). >> > > 'factorize-uri' is better, so I'm using that now. I created a new > module '(guix import utils)' for commonly used import procedures. > > New patch attached. Perfect, OK to push! Ludo=E2=80=99.