[Biopython-dev] Python 2 and 3 migration thoughts

Peter Cock p.j.a.cock at googlemail.com
Sun Oct 6 17:50:18 EDT 2013


On Sun, Oct 6, 2013 at 3:03 PM, Peter Cock wrote:
> On Sat, Oct 5, 2013 at 10:36 PM, Peter Cock wrote:
>>
>> Incorporating another new feature branch gives:
>>
>> 387 no change, 161 need fixers
>> Troublesome ones 29.4%
>>
>> The new batch of 2to3 issues solved is changes to
>> built in functions like range, zip, map, filter. Branch:
>> https://github.com/peterjc/biopython/tree/builtins
>> https://github.com/biopython/biopython/pull/246
>
> I've added basestring and input to the builtins branch
> (pull request updated), helps even more.
>
> However, I realised I am effectively reimplementing the
> MIT licensed 'six' library with 'Bio._py3k' and it would
> be simpler to just use that instead (and that would make
> life easier for contributors already using 'six' on other
> projects):
>
> https://pypi.python.org/pypi/six/
> https://bitbucket.org/gutworth/six
> http://pythonhosted.org/six/
>
> Expect a slight reworking of these branches to appear
> later, bundling a copy of 'six' ...

New branch is https://github.com/peterjc/biopython/tree/six
with 'six' bundled and using this for more import fixes.

Using that work, we're now at under a quarter of the files
needing 2to3 changes using the modified do2to3.py,
https://github.com/peterjc/biopython/tree/mark2to3c
https://travis-ci.org/peterjc/biopython/builds/12208302

416 no change, 132 need fixers
Troublesome ones 24.1%

Progress :)

Peter


More information about the Biopython-dev mailing list