8000 Voice response devx5021 and Python testing, compatibility by ilanbiala · Pull Request #346 · twilio/twilio-python · GitHub
[go: up one dir, main page]

Skip to content

Voice response devx5021 and Python testing, compatibility #346

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

Merged
merged 5 commits into from
Jun 15, 2017

Conversation

ilanbiala
Copy link
Contributor
  • Fixes VoiceResponse.conference does not pass on the muted parameter
  • Fixes Travis-CI to properly run tests using correct version of Python
  • Fixes tests to support both Python 2 and Python 3
  • Drops Python 2.6 support (Breaking Change)

@@ -1,7 +1,7 @@
.PHONY: clean install analysis test test-install develop docs docs-install

venv:
virtualenv venv
virtualenv --python=python venv
Copy link
Contributor

Choose a reason for hiding this comment

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

whats the benefit of doing --python=python? Isnt that the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding --python=python uses the standard alias Travis-CI sets up in each environment, which seemed to be the simplest way to use the intended test version. I can look around for another way if you think there is one.

try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to do this in the compat.py file and then import urlparse from that so this file doesnt have to care which versio 8000 n of python its being run under.

@@ -70,7 +73,8 @@ def request(self, method, url, params=None, data=None, headers=None, auth=None,
timeout=timeout,
)

return Response(int(response.status_code), response.content.decode('utf-8'))
# return Response(int(response.status_code), response.content.decode('utf-8'))
Copy link
Contributor

Choose a reason for hiding this comment

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

remove comment

lineno=func.func_code.co_firstlineno + 1
)
warnings.simplefilter('always', DeprecationWarning)
warnings.warn("Call to deprecated function {}.".format(func.__name__), category=DeprecationWarning, stacklevel=2)
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this need to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

func.func_code is no longer an attribute in Python 3, and the decorator is only used on grants.py:108.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

ilanbiala added 3 commits June 2, 2017 10:57
…sing correct Python version in each test environment)

Install appropriate version of virtualenv for python, fixes Python 3.6 build because Travis-CI comes with virtualenv 12.0.1 by default
@ilanbiala
Copy link
Contributor Author

Pushing fixes and ammending commits.

@ilanbiala ilanbiala force-pushed the voice-response-devx5021 branch 11 times, most recently from d922f61 to af88416 Compare June 5, 2017 20:10
twilio/compat.py Outdated
@@ -1,3 +1,5 @@
import six
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this.

Copy link
Contributor
@jingming jingming left a comment

Choose a reason for hiding this comment

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

LGTM

@jingming jingming added the deploy label Jun 5, 2017
@ilanbiala ilanbiala force-pushed the voice-response-devx5021 branch from af88416 to 3519817 Compare June 5, 2017 20:38
@dougblack dougblack merged commit 81ad4b8 into master Jun 15, 2017
@ilanbiala ilanbiala deleted the voice-response-devx5021 branch June 15, 2017 18:41
@ilanbiala ilanbiala restored the voice-response-devx5021 branch June 15, 2017 18:41
@ilanbiala ilanbiala deleted the voice-response-devx5021 branch June 15, 2017 18:43
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
0