[Biopython-dev] Calling 2to3 from setup.py

Peter biopython at maubp.freeserve.co.uk
Mon Jan 17 00:38:05 UTC 2011


On Tue, Jan 4, 2011 at 11:30 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
> On Tue, Jan 4, 2011 at 10:43 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
>> Hi all,
>>
>> Something we've talked about before is calling lib2to3 or the 2to3 script
>> from within setup.py to make installing Biopython simpler on Python 3.
>>
>> ...
>>
>> I then looked at how NumPy are doing this, and they have a hook
>> in setup.py which calls their own Python script called py3tool.py to
>> do the conversion, ... it will not bother to reconvert previously
>> converted but unchanged files. ...
>
> ... So
> on reflection, using the time stamp to decide if 2to3 needs to
> be rerun is probable quite sufficient (and will be faster too).
>
> Peter
>

I switched to the simpler approach used by NumPy (just look
at the last modified timestamp) and committed this:

https://github.com/biopython/biopython/commit/1eeed11aefc54787fb836a6b3b5f4c82628edef4

I've had to tweak the buildbot accordingly: it no longer needs
to call the 2to3 script, and the tests must be run from the
converted version rather than the original Python 2 version
of the code.

Peter



More information about the Biopython-dev mailing list