From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Python 3 binaries Date: Sun, 01 Sep 2013 19:34:03 +0200 Message-ID: <87k3j0igz8.fsf@gnu.org> References: <20130831153018.GA5442@debian> <5222282D.7000801@gmail.com> <20130901092817.GA19604@debian> <87d2osoczg.fsf@gnu.org> <20130901143907.GA23394@debian> 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]:43548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGBcM-0007Uu-EQ for guix-devel@gnu.org; Sun, 01 Sep 2013 13:39:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGBcA-0006IS-MJ for guix-devel@gnu.org; Sun, 01 Sep 2013 13:39:18 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:59169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGBcA-0006IL-BY for guix-devel@gnu.org; Sun, 01 Sep 2013 13:39:06 -0400 In-Reply-To: <20130901143907.GA23394@debian> (Andreas Enge's message of "Sun, 1 Sep 2013 16:39:07 +0200") List-Id: 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: Andreas Enge Cc: guix-devel@gnu.org Andreas Enge skribis: > On Sun, Sep 01, 2013 at 04:03:47PM +0200, Ludovic Court=C3=A8s wrote: >> Ah, so packages that work with Python 3 expect a =E2=80=98python=E2=80= =99 (and not >> =E2=80=98python3=E2=80=99) executable? > > Apparently so. And anyway, packages that work with both versions usually > start their scripts with #!/usr/bin/python. OK. >> Then that=E2=80=99s a different story (I thought =E2=80=98python3=E2=80= =99 was the official name >> for the binary.) >>=20 >> I=E2=80=99d rather not have specific things like that in =E2=80=98patch-= shebangs=E2=80=99. So, >> what we could do is: >> =E2=80=A2 Leave =E2=80=98python-3=E2=80=99 as is, without the symlink. >> =E2=80=A2 Add a =E2=80=98python-3-wrapper=E2=80=99 package that just c= ontains =E2=80=98bin/python=E2=80=99 >> pointing to =E2=80=98=E2=80=A6/bin/python3=E2=80=99 (using =E2=80=98= trivial-build-system=E2=80=99.) >> =E2=80=A2 When building Python 3 packages, we=E2=80=99d use the wrappe= r, not the real >> one; however, users would install the real one in their environment. > > This would be a possibility. > > Personally, I find the solution rewriting the shebangs cleaner, but this > is more a matter of taste than anything. > > The wrapper would require the user to install both python-3 and the wrapp= er > (or contain python-3 as a propagated input), so that the user has all fil= es > in the python-3 package. This is slightly ugly. Users would typically only need to install the wrapper; that=E2=80=99s enou= gh since it holds a reference to the real Python. However, my understanding from what Cyril and Brandon said is that users may prefer to have it called =E2=80=98python3=E2=80=99 by default, so they = can install both Python 2 and Python 3 in parallel. Furthermore, they can choose to have (say) an alias python=3Dpython3 if that=E2=80=99s what they want. Based on that, I thought the wrapper would be mostly for internal consumption. Did I get it right? > The solution with the wrapper has the advantage that users who want only > Python 3 and not Python 2 would then get a binary named "python" pointing > to version 3, useful also for their own code. But somewhere it would have > to be documented that they then have to install python-3-wrapper and not = just > python or python-3. > > But the naming is not very clear; why do I need to install python-wrapper > if I just want the latest version of Python? > How about calling the package python-default and having it contain python= -3 > as a propagated input? We could even have a version 2 of this package, wh= ich > would be empty with only python-2 as a propagated input. Then the user co= uld: > > - install python-default =3D python-default-3 and get only Python 3, > with binaries "python" and "pydoc" pointing to "python3" and "pydoc3", > respectively; > - install python-default-2 and get only Python 2. > - install python-2 and python =3D python-3 to get both of them, with > "python" pointing to Python 2. > > What do you think? My understanding was that users (really: Python developers) would expect to get a =E2=80=98python3=E2=80=99 binary when they install the latest, and= a =E2=80=98python=E2=80=99 binary otherwise. Then that means we don=E2=80=99t really have to worry, and just document th= at the python-3.x package is an unmodified upstream package, with its binary is called =E2=80=98python3=E2=80=99. WDYT? Ludo=E2=80=99, who=E2=80=99d really appreciate feedback from the Python-sav= vy. :-)