Skip to content

Fix for python3 issues#36

Open
thoas wants to merge 10 commits into
disqus:masterfrom
thoas:master
Open

Fix for python3 issues#36
thoas wants to merge 10 commits into
disqus:masterfrom
thoas:master

Conversation

@thoas

@thoas thoas commented Jul 29, 2015

Copy link
Copy Markdown
  • Add a compat layer for missing methods or moved methods (based on six)
  • Fix bytes issues when using crc32
  • Some flake8 issues

Available if you want more information.

@mattrobenolt

Copy link
Copy Markdown
Collaborator

@thoas looks like all of the python 3 tests fail because our dependencies aren't python 3 compatible. :(

@thoas

thoas commented Jul 29, 2015

Copy link
Copy Markdown
Author

@mattrobenolt yep, it seems pycassa is not compatible at all with python3 : even the current master doesn't pass at all.

Do you have a recommendation for this case? I think we need to disable pycassa tests for py3.

@mattrobenolt

Copy link
Copy Markdown
Collaborator

I'm not sure off the top of my head. I think that's reasonable though if that's the only incompatibility.

tbh though, I'd like to rip out pycassa support since that's silly in nydus. :) Not sure why it was a thing in the first place.

@mattrobenolt

Copy link
Copy Markdown
Collaborator

Also, pycassa is deprecated in favor of https://github.com/datastax/python-driver, so I'd be open to ripping that out if we get full python 3 compat without it.

thoas added 3 commits July 30, 2015 10:01
* Rename assertEquals to assertEqual
* Rename assertNotEquals to assertNotEqual
* Add httplib and next in compat
* Fix map use cases which does not return a list anymore in py3
@thoas

thoas commented Jul 30, 2015

Copy link
Copy Markdown
Author

@mattrobenolt I have disabled pycassa tests in Python 3 context.
I think, it would be better to remove the support in another PR.

I need your brain on a nasty choice in Python 3, mine is melting.

======================================================================
ERROR: test_nonzero (tests.nydus.db.connections.tests.EventualCommandTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/thoas/Sites/Python/ulule/nydus/tests/nydus/db/connections/tests.py", line 354, in test_nonzero
    self.assertEqual(int(ec or 0), 0)
  File "/Users/thoas/Sites/Python/ulule/nydus/nydus/db/promise.py", line 140, in __len__
    return len(self.__wrapped)
TypeError: object of type 'NoneType' has no len()

I lost the self when resolving a promise to None which is ok since it's the exact behavior on Python 2, but ec or 0 in Python 3 is stricter and raises an exception instead of keeping the 0 default value.

What do you suggest for these case scenario?

@thoas

thoas commented Aug 4, 2015

Copy link
Copy Markdown
Author

@mattrobenolt 🎉 🎉 tests are passing on py2/py3

Give me your feedback when you will have the time :)

@thoas

thoas commented Aug 9, 2015

Copy link
Copy Markdown
Author

@mattrobenolt any time on your side to review this PR?

Thanks :)

@mattrobenolt

Copy link
Copy Markdown
Collaborator

This mostly seems ok to me.

/cc @dcramer opinions?

@dcramer

dcramer commented Aug 10, 2015

Copy link
Copy Markdown
Collaborator

idc you guys are in charge :)

@mattrobenolt

Copy link
Copy Markdown
Collaborator

:rage4:

@mattrobenolt

Copy link
Copy Markdown
Collaborator

I'm going to review this and compare with my progress that I made on my py3 branch from a while ago that I didn't finish.

master...py3 for reference.

@thoas

thoas commented Aug 10, 2015

Copy link
Copy Markdown
Author

We are in charge 😱 😱

@thoas

thoas commented Sep 2, 2015

Copy link
Copy Markdown
Author

@mattrobenolt any feedback on this?

Thank you :)

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

Successfully merging this pull request may close these issues.

3 participants