prisma-labs / python-graphql-client

Simple GraphQL client for Python 2.7+
MIT License
155 stars 46 forks source link

Fixed to support python 3 #2

Closed ssshah86 closed 7 years ago

ssshah86 commented 7 years ago

urllib2 doesn't exist within python3. The proposed changes should be compatible with python2 and 3, tested on 2.7.13 and 3.6.0.

Sorry looks like I commited this early without running more tests, let me refine & push a new update to fix compatibility with both Python2 and 3.

schickling commented 7 years ago

Thanks a lot for this great contribution!

rcy commented 7 years ago

Does the version need to be bumped in setup.py and a new version uploaded to pypi?

ssshah86 commented 7 years ago

Yes, I believe the graphcool team is pretty busy and will get to that soon.

schickling commented 7 years ago

It's been a while since we've dealt with Python packages the last time. What's the command needed to publish a new version @ssshah86?

ssshah86 commented 7 years ago

<python setup.py register -r pypi> and <python setup.py sdist upload -r pypi>

But @rcy is right, the version should be incremented first otherwise PyPI will reject it.

see: http://sherifsoliman.com/2016/09/30/Python-package-with-GitHub-PyPI/#release-testing

schickling commented 7 years ago

This is what I'm getting here. Can I add you as a collaborator somehow?

image

ssshah86 commented 7 years ago

Yea my PyPI u/n is ssshah86, but I believe you have to update it in setup.py for me to be a maintainer though.

I think it's the version of Python you are using, 3.5.2. There's an update in distutils for 3.5.3 that uploads to pypi.org instead of pypi.python.org, which was shut down July 3rd.

What's the repository information in your .pypirc file? If you upgrade you can delete the line starting with repository and you will use your upload tool’s default URL.

OR you can also use twine by installing it via pip3 install twine, which should be version 1.9.x. Then after you build your source dist, you can use twine upload --repository testpypi dist/* where the --repository flag will read from your.pypirc file.

schickling commented 7 years ago

Added you as an owner on PyPI!

ssshah86 commented 7 years ago

Thanks. Just uploaded v0.2.0. Everything looks great. There's one issue when upgrading on OSX when installing something with a dependency on the package 'six', detailed here: https://github.com/pypa/pip/issues/3165

ssshah86 commented 7 years ago

you can uninstall and reinstall to avoid the error

rcy commented 7 years ago

Just installed 0.2.0 here, everything is working great... thank you both for your work!