cruzdb icon indicating copy to clipboard operation
cruzdb copied to clipboard

Figure out what needs to be done for Python 3 compatiblity

Open lbeltrame opened this issue 10 years ago • 8 comments

Given that SQLSoup and SQLalchemy are all Python 3 compatible, the next step is to find the potential points of issues directly in cruzdb.

In particular:

  • [ ] Figure out how the bundled SQLSoup is different than the stock one
  • [ ] Track issues that 2to3 can't fix (strings vs bytes etc)
  • [ ] Move to a library like six to keep everything compatible with a single codebase (optional?)

lbeltrame avatar Mar 20 '14 13:03 lbeltrame

+1, i'm converting the easy stuff like print statements today.

brentp avatar Mar 20 '14 15:03 brentp

Then you can answer one of my questions ;) : why the bundled SQLSoup? And what differences does it have from stock SQLSoup?

lbeltrame avatar Mar 20 '14 15:03 lbeltrame

I can't remember. I will try to remove it. I will plan to use six for most stuff.

brentp avatar Mar 20 '14 15:03 brentp

Any update on python-3.3 compatibility? Thanks!

dylkot avatar Feb 21 '15 18:02 dylkot

@dylkot can you try the py3 branch?

brentp avatar Feb 22 '15 05:02 brentp

Sorry for the slow response I gave it a try and made few superficial changes (print statements, some import statements, and a try/except statement) and so now:

from cruzdb import Genome" 

works fine. The problem comes with:

g = Genome("hg19")

I get the error:

ImportError: No module named 'MySQLdb'

From what I can tell MySQL-python doesn't support python3 right now (see http://stackoverflow.com/questions/20049590/pip-3-3-install-mysql-python) so would need to figure out a solution for that. Might be a bit more than I have bandwidth for at the moment though.

dylkot avatar Feb 27 '15 04:02 dylkot

so would need to figure out a solution for that. Might be a bit more than I have bandwidth for at the moment though.

Install "oursql" and use a full SQLalchemy-style URL for connecting including the driver (see the SQLalchemy docs).

lbeltrame avatar Feb 27 '15 06:02 lbeltrame

I am running into this for python 3.4.3 File "/home/aulloa/.virtualenvs/p3/lib/python3.4/site-packages/cruzdb/sqlsoup.py", line 458 except KeyError, ke: ^ SyntaxError: invalid syntax

alvarouc avatar Feb 24 '16 22:02 alvarouc