-
Notifications
You must be signed in to change notification settings - Fork 116
Httplib2 py2/py3 shim and other py3 compat fixes #109
Conversation
Seems the tests are failing due the docker login command, unrelated to my changes. |
@deft-code Any chance to get feedback on this? |
This is not working for me. It seems that the path is somehow misconfigured such that even the python3 import of concurrent.futures ends up importing concurrent_py2.concurrent.futures:
I will investigate and try and fix shortly. |
Sorry, this is a bit beyond my current Bazel skills to fix in a clean way. Perhaps someone with more knowledge here can fix it. |
Hm, even once I get that to work, when I actually use the puller.par, another error, having to do with a string/bytes change in python3. Here's how I made it work in python3, though I again don't know the clean way to make it backwards-compatible:
|
@dmitrig01 Thanks for testing it out and evaluating, let me have another look. |
@dmitrig01 Oh yeah that is strange about the futures - how did you fix it for you? Edit: Ok should have managed to fix both issues in a py2/3 compatible way. |
I just removed the concurrent_py2, because I don't need Python 2 to work :-). But as far as I could tell, the problem was as follows:
The pythonpath has (at least) the following things on it:
I believe what that means is that it's looking inside concurrent_py2, and seeing a package called concurrent - thus I think this is the issue, but it could be that my understanding of pythonpath isn't quite right either... |
Yep the issue is related to: bazelbuild/bazel#5899 - but yeah will hopefully have a fix for that soon. |
ah nice, yes, that's the same issue |
I was thinking we could patch around it by having some file/directory renaming in build_file_content in the mean time -- I would assume that a fix to that issue will take a while to land. But not sure what the ethos of these projects is :-) |
Yeah that is basically what I did now. It does work for me locally now but strangely enough I am getting an error when I try to copy |
Ok I think I figured out what the issue is and yeah it seems wee will need to create a new subdirectory so we can still maintain the |
There is also bazelbuild/bazel#6532 now, so we might just need to wait for a newer bazel version to have this fixed. |
For others experiencing this issue, the quick and dirty workaround is to |
bazelbuild/bazel#6532 is coming along; perhaps this can be picked up soon. |
Yes, also the whole work on better python2/3 mixing that should be in bazel 0.23 might be able to fix that. Let's see how it looks with the rc next week. |
Is there anything we can do to accelerate Python 3 support? Lack of support is giving lots of problems in kubernetes-sigs/cluster-api-provider-aws#624 |
@randomvariable now with bazel 0.23 out it is possible to only choose a dependency for py2 or py3, so this PR could be fixed and simplified. I am just not sure when I would get to it next. |
is this going to get merged anytime soon? lack of py3 support is preventing our monorepo from switching over to using bazel. |
@codebreach sorry for just replying now, I dropped this as bazel has much better support for py2/3 now and because rules_docker will drop this containerregistry and already started switching over to the go version. Happy for anyone else to pick this up. |
Quite a few people are interested in this, it seems that Google is not making the Py2=>Py3 jump as quickly as most (or even at all) and this project is one of the victims. To make matters worse this project is not (actively) maintained: #114 (comment). The following issue: bazelbuild/rules_docker#580 tracks the progress made on switching to a Go-based container registry in the main While that work is on-going it may be worthwhile to fork this project, fix Python-3 compatibility and ask |
Ok I've created two forks that get seem to pass basic tests for me, will keep testing with it but would appreciate other people's input:
To test it, switch out the
|
The comment here: #42 (comment) said hat we could "shim" over the py2/3 versions of httplib2 so that is what I tried to do. I am not sure if that is what was meant but from my local testing things seem to work.
I also had to fix the loading of the concurrent backport library and removed the seemingly unused oauth2client. Also the tests now get run with python3.
Fixes #42 and #97