Hello xmms2-devel,

Some of you have probably heard of Python 3. It's great, and it's also not 
quite compatible to Python 2. And more and more libraries are starting to 
support it. PyQt4 have already released a Python 3 compatible version, and 
there are efforts to support Python 3 lurking somewhere in the depths of the 
pygobject/pyglib git trees. I wonder when that'll be done.

Anyway, it's not that difficult for a package like xmmsclient to support Py3k: 
We've been using Pyrex to generate the bindings, which doesn't support Py3k, 
but there's a popular fork called Cython that's being actively developed, and 
that has excellent support for building Python 2 and Python 3 modules from one 
source file.

So, what I did is: I told waf to use cython instead of pyrex, changed a few 
lines so that cython would compile them, and made some adjustments here and 
there to enable Python3 support. And, as far as I can tell, it works. The git 
branch can be found here:

http://code.jollybox.de/git/?p=xmms2-tjol.git;a=summary

The tricky thing, really, is building. (Ah, good old waf) -- the switch from 
Pyrex to Cython is utterly unproblematic, but I'm not sure how best to tell 
waf to use Python 3, or any specific Python version for that matter. How do 
Linux distributors do it? This is further complicated by the fact that waf 
itself won't run with Python 3, and I don't think anybody around here at least 
wants to port *that*. What I ended up doing for my tests was, after ./waf 
configure, edit _build_/c4che/default.cache.py and replace all instances of 
"2.6" with "3.1". Is there any civilized way to do this?

Cheers, 
Thomas

PS: Is there a Python-based client that doesn't use PyGtk or other Python2-
only modules that one could test/port with this?

--
_______________________________________________
Xmms2-devel mailing list
[email protected]
http://lists.xmms.se/cgi-bin/mailman/listinfo/xmms2-devel

Reply via email to