Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3 support? #56

Closed
wwood opened this issue Sep 2, 2015 · 4 comments
Closed

python 3 support? #56

wwood opened this issue Sep 2, 2015 · 4 comments

Comments

@wwood
Copy link

wwood commented Sep 2, 2015

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
Copy link
Member

cmccoy commented Sep 2, 2015

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

@crosenth
Copy link
Member

crosenth commented Mar 5, 2016

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
Copy link
Member

nhoffman commented Dec 6, 2017

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:

  • @crosenth describes the difficulty of including support for bz2 compression above, also see restore support for bz2 compression  #66; I decided it was more important to get to py3, and left bz2 support for another time
  • maintaining support for both 2.7 and 3+ seems like a lot of work at this point, particularly with python2 slated for EOL in 2020. So I haven't made any attempt to maintain python2 compatibility.

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
Copy link
Member

nhoffman commented Jan 6, 2018

support for python 3.4+ added in version 0.7.0

@nhoffman nhoffman closed this as completed Jan 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants