From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-python+bounces-201-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AEA74138010 for <garchives@archives.gentoo.org>; Fri, 2 Nov 2012 09:02:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 800CB21C089; Fri, 2 Nov 2012 09:02:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6724821C08F for <gentoo-python@lists.gentoo.org>; Fri, 2 Nov 2012 09:02:19 +0000 (UTC) Received: from pomiocik.lan (213-238-96-169.adsl.inetia.pl [213.238.96.169]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 8BCE433D88B; Fri, 2 Nov 2012 09:02:17 +0000 (UTC) Date: Fri, 2 Nov 2012 10:03:05 +0100 From: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= <mgorny@gentoo.org> To: Brian Harring <ferringb@gmail.com> Cc: Mike Gilbert <floppym@gentoo.org>, gentoo-python@lists.gentoo.org Subject: Re: [gentoo-python] Re: [PATCH eselect-python 1/2] Store per-version interpreter preference in a file as well. Message-ID: <20121102100305.4acfc927@pomiocik.lan> In-Reply-To: <20121101224242.GE3299@localhost> References: <1351770893-1217-1-git-send-email-mgorny@gentoo.org> <CAJ0EP41Ww9GKYto8A8gX-L+D2=3+MFhYHmUZXZNvm+Ni5ApSbw@mail.gmail.com> <CAJ0EP42u9vNaC70ui-YPjRR1SOY9n8fCmnXA1EgijmRdsRdK8Q@mail.gmail.com> <20121101222719.2717ff05@pomiocik.lan> <20121101224242.GE3299@localhost> Organization: Gentoo X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.13; x86_64-pc-linux-gnu) Precedence: bulk List-Post: <mailto:gentoo-python@lists.gentoo.org> List-Help: <mailto:gentoo-python+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-python+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-python+subscribe@lists.gentoo.org> List-Id: Discussions centering around the Python ecosystem in Gentoo Linux <gentoo-python.gentoo.org> X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA256; boundary="Sig_/BLT41ucUHqzKflbTVab/FcP"; protocol="application/pgp-signature" X-Archives-Salt: 783a04d2-55a0-4a03-8be5-bd45d05c04ac X-Archives-Hash: 44f5cc75a127bdd785eaca220f60c739 --Sig_/BLT41ucUHqzKflbTVab/FcP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 1 Nov 2012 15:42:42 -0700 Brian Harring <ferringb@gmail.com> wrote: > On Thu, Nov 01, 2012 at 10:27:19PM +0100, Micha?? G??rny wrote: > > On Thu, 1 Nov 2012 14:48:55 -0400 > > Mike Gilbert <floppym@gentoo.org> wrote: > >=20 > > > On Thu, Nov 1, 2012 at 11:44 AM, Mike Gilbert <floppymaster@gmail.com= > wrote: > > > > On Thu, Nov 1, 2012 at 7:54 AM, Micha?? G??rny <mgorny@gentoo.org> = wrote: > > > >> The idea is very simple: /etc/env.d/python/python[23] with a one-l= ine > > > >> value similar to the main interpreter /config file. > > > >> > > > >> That should be simpler & more reliable than reading a symlink. And= at > > > >> some point we can replace the symlink with an $EPYTHON-aware wrapp= er > > > >> as well. > > > > > > > > I don't understand the point of this. Do we have some need to enable > > > > EPYTHON usages for scripts that have a python2 or python3 shebang? > > > > > > > > I also don't understand how a text file is more reliable than a > > > > symlink; they are basically the same thing, but the symlink has a > > > > different file mode. > >=20 > > Ah, and I'd forget. I have the following dream: > >=20 > > /etc/env.d/python/python2 > > /etc/env.d/python/python3 > > /etc/env.d/python/config -> python2 > >=20 > > So, python{2,3} keep the per-version interpreters, and config is just > > a symlink to one of them. Two bird with one stone -- readlink to get > > which group is enabled, cat to get the exact interpreter. I'm proud > > of myself! >=20 > I too have a dream; git://pkgcore.org/eslect-python . >=20 > That's a shebang based version of what I proposed a while back. It=20 > works now and has tests. It's written to be basically a drop in for=20 > existing python.eclass generation of shebangs, w/ the=20 > hardlinking/de-duplication/farking-fast/fix python3.2=20 > /usr/bin/sphinx-build scenario. Could you please provide an explanation of what it does? I mean, a few points of what happens when you run it in various scenarios. That's 600 lines of C code, I think Python folks would appreciate not having to read that line by line. > The remaining work for that is thus: >=20 > 1) If the EPYTHON targets aren't given via shebang arg, then it needs > to fallback to grabbing the targets from the file (easy enough). >=20 > 2) Add a few helpers/wrappers to make it easier to do the=20 > deduplication/shebang rewriting. How would you perform deduplication while you're at it? Could you measure or at least consider the benefits of it? > Frankly, you should be looking at this imo, rather than trying=20 > standalone files. Yes, files is simpler- but you'll wind up sooner or=20 > later rebuilding it into what I already built out here. I think you are missing the point I'm raising here. Mostly because your python-wrapper doesn't handle per-version preferences like python-exec does, unless I'm missing something. > """ > Add a python-shebang utility, slave python-wrapper to it. >=20 > Going forward, the intent is to push the PYTHON_ABIs of a given > script down into it's shebang, pointing the shebang at python-shebang. >=20 > In this way, all known/supported abi's are available at the time of > execution; further, if the target is told to respect-EPYTHON (meaning > no searching for something to execute, either active python version or > EPYTHON var), we can push this down into that list and have that code > handle it. >=20 > [...] > > to the simpler form of: > for x in sphinx{,-{2.7,3.2}}; do echo > $x <<EOF > #!/usr/bin/python-shebang python2.7,python3.2 > <code> > EOF > done Hmm, are you assuming that /usr/bin/sphinx carries the actual code? Or some special wrapper code? Not to mention you still bind the whole thing to installed package. If you need to fix those files, you need to reinstall all packages installing them. > The gains of this are thus: Could you please compare it to the modern solution (python-exec) rather than the deprecated one? You are no longer on the uncharted waters. --=20 Best regards, Micha=C5=82 G=C3=B3rny --Sig_/BLT41ucUHqzKflbTVab/FcP Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iJwEAQEIAAYFAlCTjE0ACgkQfXuS5UK5QB3KegP/aFI9LlipJ/z8lAJIZwRC8SV1 C5UnUEUt5ZONcpCidxC4Z0rqjZXXipX8WxUPPgt7+C7bwK9sOxIRl/Z+C3/6nc3I QqeaXcBKa0uq/gRU+mIOJ8BH7ITJIRpYetaWe94PDZqhH035wjQMCCWzkn6kZvuK 8SeSwcc9gcZEpAZGWuk= =bRhi -----END PGP SIGNATURE----- --Sig_/BLT41ucUHqzKflbTVab/FcP--