Skip to content

Added python 3 support and cleaned up some testing files#22

Closed
Henry R (henryrizzi) wants to merge 5 commits into
openx:developfrom
henryrizzi:develop
Closed

Added python 3 support and cleaned up some testing files#22
Henry R (henryrizzi) wants to merge 5 commits into
openx:developfrom
henryrizzi:develop

Conversation

@henryrizzi

Copy link
Copy Markdown

I changed the library to use response.text rather than response.content as this will allow the text to be automatically decoded in both python 2.6+ and python 3. Also, the six library is used to bridge the gap between python 2 and 3.

Comment thread ox3apiclient/__init__.py Outdated
self._token['verifier'] = parse_qs(response.content)['oauth_verifier'][0]

self._token['verifier'] = parse_qs(response.text)['oauth_verifier'][0]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

…exts and removed trailing whitespace in __init__.py
@henryrizzi

Copy link
Copy Markdown
Author

The trailing whitespace has been purged from init.py
client.py has been fixed to not use any fancy 2.7 features context features

The client.py tests won't all run right now, but the delete test is still failing on master. On python 2.6, a few tests will fail because of differences in the way that failUnlessRaises works in different versions, but the actual api should still function.

Comment thread .gitignore Outdated
ox3apiclient.egg-info/
landing/*
build/*
dist/*

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these folders look specific to your environment. Maybe you want to change your ~/.gitignore instead.

@henryrizzi

Copy link
Copy Markdown
Author

I just removed those folders from my .gitignore. the egg-info is jut the file generated in python3 when you run python setup.py develop and the other ones are for installing using python2 variants. landing was just specific to me, but I removed all 4 items from the .gitignore anyway.

@marcsantiago

Copy link
Copy Markdown

How stable is this branch for production? It looks a lot cleaner than the requests_oauthlib branch i'm currently using.

@henryrizzi

Copy link
Copy Markdown
Author

I've used it to get a lot of reports, but so far haven't had to do anything with deleting, posting or putting. For getting reports at least, it is very stable and I haven't run into any issues so far on python 3.5.2

@haohany

haohany commented Jul 26, 2016

Copy link
Copy Markdown

I use it mainly to create and delete objects in API. requests_oauthlib is merged into this branch and some bugs are fixed.

@henryrizzi

Copy link
Copy Markdown
Author

Has anyone else tested this for their use case using python 3?

@openx-luis

Copy link
Copy Markdown
Contributor

Superseded by #33

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.

4 participants