googleapis / google-api-python-client

🐍 The official Python client library for Google's discovery based APIs.
https://googleapis.github.io/google-api-python-client/docs/
Apache License 2.0
7.74k stars 2.41k forks source link

Python 3 #3

Closed rozling closed 9 years ago

rozling commented 10 years ago

Request for Python 3 support (continuing on from https://code.google.com/p/google-api-python-client/issues/detail?id=57). My use case is for using the popular editor Sublime Text 3 to interact with the Google API.

jackgolding commented 9 years ago

+1

fsufitch commented 9 years ago

+1

gijoecool commented 9 years ago

+1

sloria commented 9 years ago

Big +1 to this.

cnelson commented 9 years ago

+1

Hard to sell people on using good technologies like discovery documents when the tools aren't there to support them.

meng-fu commented 9 years ago

+1

methane commented 9 years ago

Please test #64 with your script instead of posting more +1.

iDevPy commented 9 years ago

@methan How i can do those tests?

methane commented 9 years ago
  1. Checkout #64 and install it.
  2. Run your program using google-api-python-client.
cnelson commented 9 years ago

@methane I've been running my code under @pferate's fork for sometime now and it's working fine.

-Chris

pferate commented 9 years ago

@cnelson I would recommend trying my python3-module_updates branch (the branch in #64). There should be no difference with my python3 branch operationally. I had to go and create a cleaner branch to get the code merged upstream. The branch in #64 will hopefully be merged soon.

cnelson commented 9 years ago

@pferate I just updated my packages to build against https://github.com/pferate/google-api-python-client/zipball/python3-module_updates#egg=google-api-python-client-1.3.2 and it still looks good.

It'll be great to see this merged in, thanks for all the work!

nathanielmanistaatgoogle commented 9 years ago

As of cf939a33f6b8 we believe google-api-python-client fully supports Python 3. Please everyone try it out and let us know where and how we've created problems. :-)

tommyjcarpenter commented 9 years ago

NATHANIELMANISTA +10000

pferate commented 9 years ago

Feels good to finally have this taken care of.

Thanks for reviewing the code @nathanielmanistaatgoogle! Also thanks to everyone else who helped out with this, including @craigcitro and @methane!

nathanielmanistaatgoogle commented 9 years ago

@tommyjcarpenter: looks like that would be covered by either #44 or #61?

@methane, @pferate: looks like we missed a spot?

pferate commented 9 years ago

@tommyjcarpenter: that error looks like it is from an older revision. Please note that this hasn't been pushed outside of github yet (to my knowledge), so you will have to install this package manually for now.

JelteF commented 9 years ago

You can use the trick from this comment: https://github.com/google/google-api-python-client/pull/45#issuecomment-70196973 Now that it's merged you can use this in your requirements.txt

git+git://github.com/google/google-api-python-client@master#egg=google-api-python-client

And remember to use oauth2client 1.4.2 instead of the newest one.

cnelson commented 9 years ago

FWIW, this looks solid to me across python 2 and python 3. My test suite runs clean.

Any idea when we can expect to see this hit PyPI?

Tox output

py26: commands succeeded
py27: commands succeeded
py33: commands succeeded
py34: commands succeeded
flake8: commands succeeded
congratulations :)
tommyjcarpenter commented 9 years ago

Ahh, sorry, my fault! I pip3ed (which worked) without realizing this probably wasn't pushed into PyPi yet.

pferate commented 9 years ago

Not sure when it will be pushed. I created another PR (#67) to update some setup.py for PyPi, but it will be up to the Googlers to push it out.

nathanielmanistaatgoogle commented 9 years ago

Python 3 support has now been pushed to PyPI as version 1.4.0 (https://pypi.python.org/pypi/google-api-python-client/1.4.0). Please everyone test away and report defects and mistakes back to us here?

methane commented 9 years ago

@tommyjcarpenter See jcgregorio/httplib2#296

tommyjcarpenter commented 9 years ago

@methane It looks like that was not yet pushed to PyPI. Latest install 0.9 still broken. Installing from source worked!

kylegoetz commented 9 years ago

"No Python 3 Support" probably should be up front and center. I spent quite a while trying to figure out why installing with pip3 worked but the Google samples all failed on authorization. It's because clean_headers() that the docs says converts bytes to strings actually converts strings to bytes with Python 3!

wldcordeiro commented 9 years ago

@kylegoetz Read this thread, Python 3 is supported but the package on PyPI isn't updated yet.

kylegoetz commented 9 years ago

@wldcordeiro Sorry, the issue is still marked as open, so I thought that meant the issue was not resolved.

In any case, this repo instructs you to install with pip, and installing with pip downloads a version for Python 2 even if you're using pip for Python 3. So the install instructions are not correct. That's all I was trying to say: should be corrected install instructions.

tommyjcarpenter commented 9 years ago

Pip3 install from Google works now, if you install httplib2 from master from source first. That library is the one that hasn't yet been pushed to PyPi. I pip3ed the Google API without problems after installing that library.

(On my phone, sorry for any typos)

On Mar 21, 2015, at 19:21, kylegoetz notifications@github.com wrote:

@wldcordeiro Sorry, the issue is still marked as open, so I thought that meant the issue was not resolved.

In any case, this repo instructs you to install with pip, and installing with pip downloads a version for Python 2 even if you're using pip for Python 3. So the install instructions are not correct. That's all I was trying to say: should be corrected install instructions.

— Reply to this email directly or view it on GitHub.

tmatsuo commented 9 years ago

Good news! httplib2 0.9.1 is released and now it's working even if you get everything from PyPi.

tommyjcarpenter commented 9 years ago

🎉😀👍

wldcordeiro commented 9 years ago

This issue can be closed at this point.

cjerdonek commented 9 years ago

Please everyone test away and report defects and mistakes back to us here?

FYI, I'm having trouble sending e-mails with binary (PDF) attachments when using Python 3.4 (google-api-python-client version 1.4.0 and httplib2 version 0.9.1). Issue filed here.

nathanielmanistaatgoogle commented 9 years ago

This seems to be an overall success; closing this issue.

xenomachina commented 9 years ago

This page still says only 2.6 and 2.7 are supported: https://developers.google.com/api-client-library/python/start/installation

tmatsuo commented 9 years ago

@xenomachina Thanks! Filed an internal bug.

wescpy commented 9 years ago

Bug fixed... the official docs now state 2.6, 2.7, 3.3, and 3.4 are supported. Python 3 users will probably use "pip3" instead of "pip".

darth30joker commented 9 years ago

Excellent!

----  Best Regards, David Xie Founder of ScriptFan technology community - http://scriptfan.com Manager of Xi'an GDG (Google Developer Group) - http://gdgxian.org http://about.me/davidx


Everything happens for a reason. Attitude determines everything!

On 7 August, 2015 at 3:11:54 am, wesley chun (notifications@github.com) wrote:

Bug fixed... the official docs now state 2.6, 2.7, 3.3, and 3.4 are supported. Python 3 users will probably use "pip3" instead of "pip".

— Reply to this email directly or view it on GitHub.