-
Notifications
You must be signed in to change notification settings - Fork 1
qtile on Python 3 #2
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
Conversation
|
Are we just depending on python3-xlib for the tests? |
|
Yeah, this doesn't need the |
|
Yeah, I think it just needs python3-xlib for tests, it's just so it can import |
|
Well, I think all the tests pass when I run them individually (using both my patches submitted for xcffib), but running the full test suite with Python 3 still generates some errors. But, nothing is broken with Python 2.7 at this point (2.6 might now have failures, since I've been putting in some things that I think may have only been backported from 3 to 2.7, and will need some compatibility layer or |
|
Ok, cool. Will try and take a look at these a bit later today and merge them. |
|
Alright, I can get all the tests passing in Python 3 now, and I've squashed everything down. There are still some oddities with the test suite, things seem to go a bit haywire if I don't do a but not every time. |
|
I'm not sure what if any problems stem from using python3-xlib to run the test suite, it doesn't seem to be well maintained and kept up with the current python-xlib resease. I might try to bring that up to par, I've already had to get one PR into that project to get this to run. When I get home, I'll try to get this up and running as my primary window manager. |
|
On Thu, Jun 26, 2014 at 12:41:47PM -0700, Sean Vig wrote:
Ok, cool. Another option would be to just rewrite whatever we have xcffib still has a couple of bugs that might prevent it from actually
I know the first one at least prevents the systray from working, I'm In any case, thanks a bunch for working on this. I'll try and review
|
|
Hey, nobody told me this was happening! Do we really want to avoid depending on six? I was looking into adding a metaclass today (didn't do it - found a simpler solution), and it turns out it's rather hard to keep that compatible in both versions, but six makes it simple. I just think that having our own compatibility layer might make things harder in the long term. Also, what's the minimum python3 version we're aiming for? |
|
Ah, yeah, now that it's working, it may be good to mention it on the email list. I'd forgotten about fixing the metaclass for Layout. The compatibility stuff I currently have in libqtile/compat.py [1], and is fairly minimal, I don't think we really need a full fledged six compatibility layer. We can add the Currently, it's 3.3+, since it still has [1] https://github.com/flacjacket/qtile/blob/cffi-py3/libqtile/compat.py |
|
I'm okay with borrowing code from six! And 3.3+ is perfectly okay IMO, since even 3.4 is out now (doesn't seem to have any interesting changes to help porting afaik). |
|
Is there any reason to copy six in tree? xcffib depends on six, so users will have it installed anyway. |
|
...oh. welp. |
This value should be an integer (I think) and needs to be an integer to be compared to `len(qtile.groups)` on libqtile/window.py L690. Doing this, however, introduces a problem with the Python 3 tests, and so it always just returns `None`.
Make codebase compatible to run on Python 2 and 3. Key changes include: * Using Python 3 style absolute imports * Use of Python 3 print function * Proper handling of bytes/string/unicode for Python 2 and 3 compatibility * Using `//` for integer division * Addition of a compatibility layer (libqtile.compat) for things that have been moved or renamed between 2 and 3
|
The only reason is to drop a dependency, 2.6+ and 3.2+ support is fairly straightforward and requires a minimal (20 lines of code) compatibility layer (xcffib would be super easy to drop six from, since the lions' share of six calls are just |
Still not quite working in Python 3, but tests still pass in Python 2. Still working on sorting out the last of the bugs, once I do, I'll clean up the commit history/messages. Needs python3-xlib, in addition to cffi dependencies.