worldveil / dejavu

Audio fingerprinting and recognition in Python
MIT License
6.36k stars 1.43k forks source link

Add Python 3 compatibility #84

Closed nicktimko closed 4 years ago

nicktimko commented 8 years ago

A bit slap-dash, but nothing major modified. Tweaks generally break down into 4 categories:

  1. print()
  2. Builtin/library generator wrangling (xrange, izip, forcing generator evaluation...)
  3. Explicit relative imports (along with cleaning up imports I generally sorted them into stdlib vs. other)
  4. Removing spaces at end of lines (because my editor does it automatically)

Another minor tweak was explicitly encoding a string (unicode in Python 3) into UTF-8 so it could be hashed.

With the changes, running example.py works just fine, but let me know if you want the commits cleaned up a bit.

nicktimko commented 8 years ago

Forgot about the tests for some reason (see 3b04a39)... There was some trouble with ast.literal_eval (maybe the replaces to reformat the string weren't enough?), so I just did an end-around and used JSON. Python 3 absolutely requires consistent space/tab usage across the entire file, so I cleaned that in run_tests.py and for funsies the entire project after converting example.py

Again...my commit isn't super clean, but the code should be.

worldveil commented 8 years ago

My apologies for not looking at this sooner, I will do so this week!

m-anwr commented 8 years ago

When will you add python3 compatibility?

shoubamzlibap commented 7 years ago

More interest in python3 here :)

eracle commented 7 years ago

Python3 is the future!

Jack-Collins commented 7 years ago

+1

uhexos commented 7 years ago

any luck with the python 3 yet ?

loretoparisi commented 7 years ago

Btw the python 2.7 deprecation is 2020 - https://pythonclock.org/ My question is: what is the reason to move to Python3 now?

ryanmat commented 7 years ago

Any word on this?

dansuh17 commented 6 years ago

+1

worldveil commented 4 years ago

This has just been added!