-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Python3 #45
Python3 #45
Conversation
…ropriate urllib modules.
…ove it to a more central location later).
… (no longer a built-in)
…n3, else BytesIO. (I feel that there is a better way to do this)
…ry file as a string)
…ipping this for now for Python3, until a better way can be found.
For anyone trying to add this in a requirements file to test it out, (it took me longer than I care to admit to figure this out)..
|
@pferate There's at least one issue when calling discovery.build, the content needs to be decoded. There's another bug somewhere too but I'm having some trouble determining where it's occurring. Something to do with the headers.
|
@chacken It's known bug of oauth2client. Please use oauth2client==1.4.2. |
Merging PR. Decode url content if on Python 3
Are there any plans for merging this? |
@pferate Here's another decoding issue.. errors.py line 48
|
Hi @craigcitro , I wonder if you've had a chance to look through this PR. I know it's large, but it covers the entire codebase (minus the sample files). Would you want to merge this into a python3 branch to continue work? |
hi @pferate -- i haven't had a chance to look yet, but i think @nathanielmanistaatgoogle is going to be the one doing this review. i like the idea of pushing this into a python3 branch and working there, but i'll let nathaniel make the call. |
We’re excited to get this content incorporated into google-api-python-client. There are a lot of commits in this pull request (47!). Some of them have become out-of-date (2defcf1 adds a .travis.yml), many seem mechanical (f1542f7), some of them aren’t strictly germane to Python 3 (65c4874), and some of them show early draft work and experimentation that shouldn’t be brought into the canonical history of the code (391df3c). Of course the fault for the out-of-date commits lies with us for having let this pull request sit for so long. We’d like to integrate these improvements in a much more piecemeal fashion. How amenable would you be to breaking this up into several smaller pull requests? We believe that we’d like to see at least: (0) One pull request containing all of the “mechanical” Python 3-related changes to the code - those fixes made by scripts or tools that solve categories of compatibility problems across the codebase (please retain the property present in the early commits of this pull request that each single commit addresses all occurrences of exactly one problem). What do you think? Is this something you’d be willing to do? |
@nathanielmanistaatgoogle #25 is "mechanical" pull request. |
@nathanielmanistaatgoogle: I'll see what I can do. I tried to be as atomic as possible with the commits, so that should make it easier (and the reason for so many commits). My workflow was to update some of the more obvious items, then I used tox and travis to point me to the other problems to fix. I didn't use any other tools like 2to3 in my branch. |
I'll look at that and see what I can do. Thanks! |
Created PR #63 for project configuration updates (2). Expect a lot of red for 3.3 and 3.4 until I transfer over more code. |
@pferate and @methane - since you're both now actively working within hours of one another on Python 3-related changes it might be worth just checking in with each other and making sure that you're not unintentionally creating sync issues or source conflicts? I'm not aware of any problems now; I just want to make sure that you see one another's progress. |
See my latest PR #64. |
This pull request smells obviated; please close if you agree. |
[python3] refactoring
I've done some work over the past few weeks and updated the entire package to work in Python 3 (3.3 and 3.4) as well as Python 2 (2.6 and 2.7).
I focused mainly on getting all of the tests to pass. There can still be work done to clean up some parts (deprecated imports, unnecessary portions of code, etc.). I also added a Travis-CI config and have the python3 branch passing all tests.
There was one test (test_discovery: test_methods_with_reserved_names) that would not work in both versions of python because the print statement being removed. Maybe we can choose a different reserved name or have to separate tests. I wasn't sure which way you want to go, so I have it skipping it in Python 3 for now.
I also took out a questionable test (test_http: test_media_io_base_upload_from_string_io). I'm not sure if we really want to allow uploading a binary file as a string. This works in Python 2, but is fixed and not allowed in Python 3.