fhcrc / seqmagick

An imagemagick-like frontend to Biopython SeqIO
http://seqmagick.readthedocs.org
GNU General Public License v3.0
113 stars 22 forks source link

python 3 support? #56

Closed wwood closed 6 years ago

wwood commented 9 years ago

Hey,

Just wondering if seqmagick is a-ok with python3? It doesn't say so in setup.py (but it doesn't restrict it like it does for <2.7 either), and I'm having some problems installing it in python 3 so I'm unsure.

thanks.

cmccoy commented 9 years ago

Unfortunately it does not. I looked at this at some point, but there are a number of changes required for compatibility.

crosenth commented 8 years ago

I've started this here: https://github.com/fhcrc/seqmagick/tree/py3

Couple annoying issues already with Python3:

1) BZ2File files don't have a 'name' attribute: https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1290847. I've implemented a fix for this that will need to be removed after Python 3.6 is released.

2) pyvenv fails on Ubuntu 14.04, the workaround is here: http://askubuntu.com/questions/488529/pyvenv-3-4-error-returned-non-zero-exit-status-1

Python 3 file objects are not consistent with their IO modes. For instance, regular open reads files in text mode while BZ2File are in binary. Forcing BZ2File into textmode creates another level of issues. I'm slowly working through this and other other file IO issues that I haven't quite wrapped my head around.

Anyways, spent roughly a day on this. I'll work on it some more when I have time. We'll get there eventually.

nhoffman commented 6 years ago

I took another stab at python3 support (https://github.com/fhcrc/seqmagick/tree/python3-nh). I decided to start from scratch because I first needed to fix all of the errors introduced with the most recent version of biopython (eg, see #59) under python2. The version in this branch now passes all tests under python 3.4+. There were a couple of casualties:

Before we consider releasing this version, I'd be grateful for some feedback on the above decisions, particularly on python2 support. Is this going to be acceptable? I could tag the commit that fixes the biopython errors but before starting the conversion to python3 for anyone who absolutely requires the py2 version. Also, for anyone who wants to install and test:

% python3 -m venv seqmagick-env
% source seqmagick-env/bin/activate
% pip install 'git+https://github.com/fhcrc/seqmagick.git@python3-nh#egg=seqmagick'
nhoffman commented 6 years ago

support for python 3.4+ added in version 0.7.0