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

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)


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 version of python its being run under.

)

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.

5 participants

0