From owner-freebsd-python@FreeBSD.ORG Tue Jun 5 20:06:55 2012 Return-Path: Delivered-To: python@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95C00106566B; Tue, 5 Jun 2012 20:06:55 +0000 (UTC) (envelope-from jhein@symmetricom.com) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 46EC58FC0C; Tue, 5 Jun 2012 20:06:55 +0000 (UTC) Received: from gromit.timing.com (gromit.timing.com [206.168.13.209]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q55K6meR063429; Tue, 5 Jun 2012 14:06:54 -0600 (MDT) (envelope-from jhein@symmetricom.com) Received: from gromit.timing.com (localhost [127.0.0.1]) by gromit.timing.com (8.14.5/8.14.5) with ESMTP id q55K69Fo014587; Tue, 5 Jun 2012 14:06:09 -0600 (MDT) (envelope-from jhein@gromit.timing.com) Received: (from jhein@localhost) by gromit.timing.com (8.14.5/8.14.5/Submit) id q55K69xf014586; Tue, 5 Jun 2012 14:06:09 -0600 (MDT) (envelope-from jhein) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20430.26288.949943.612255@gromit.timing.com> Date: Tue, 5 Jun 2012 14:06:08 -0600 From: John Hein To: Ruslan Mahmatkhanov In-Reply-To: <4FCE4514.1020901@yandex.ru> References: <20120605120755.GA71005@ithaqua.etoilebsd.net> <4FCDF80F.3070304@yandex.ru> <20430.15706.546137.332233@gromit.timing.com> <4FCE4514.1020901@yandex.ru> X-Mailer: VM 8.2.0b-8.2.x-reddyuday.r1325 under 24.0.93.1 (i386-portbld-freebsd7.4) Cc: Baptiste Daroussin , python@FreeBSD.org Subject: Re: Python conflicting with other python when installed from packages X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 20:06:55 -0000 Ruslan Mahmatkhanov wrote at 21:42 +0400 on Jun 5, 2012: > John Hein wrote on 05.06.2012 21:09: > > Ruslan Mahmatkhanov wrote at 16:14 +0400 on Jun 5, 2012: > > > Packages that using 2to3 to convert their code on install to be python3 > > > compatible looking exactly for `2to3' executable. So such a modification > > > would require modifying all the setup.py's according the python version > > > user has installed as default. It's just a though. I didn't see how to > > > resolve this correctly. > > > > One way: pull out 2to3 to its own separate port and have those > > ports that need it specify the dependency. And, no, I don't > > have patches. > > Well, then we'll get separate 2to3 ports that is conflicting :). I'm not > sure that 2to3 is the same in all python distributions. It was my understanding that you should be able to use lib/pythonXXX/lib2to3 from any recent python distribution (2.x or 3.x) interchangeably. A quick glance at a diff between lib2to3 on 2.7 and 3.2 seems to confirm that. Corrections welcome. I doubt the few ports that explicitly rely on 2to3 (sorry, I have not fully audited the ports to figure out which ports do, but I expect it's a small number, possibly 0 [1]) care whether XXX is 2.7 or 3.2. If my assertion is correct, the proposed 2to3 port would just contain one file: % cat /usr/local/bin/2to3 #!/usr/bin/env python import sys from lib2to3.main import main sys.exit(main("lib2to3.fixes")) (where this is the only difference between old and new: --- 2to3.orig 2012-06-05 12:44:17.000000000 -0600 +++ 2to3 2012-06-05 12:44:30.000000000 -0600 @@ -1,4 +1,4 @@ -#!/usr/local/bin/python2.7 +#!/usr/bin/env python import sys from lib2to3.main import main And the 2to3 port would have a (run) dependency on python (any installed version will do). [1] py-sqlalchemy is one, sort of. It has a script that imports lib2to3 directly instead of invoking 2to3.