-
Notifications
You must be signed in to change notification settings - Fork 690
/
UPGRADE.html
200 lines (194 loc) · 15.6 KB
/
UPGRADE.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><!--Google Tag Manager--><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'%26l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-MWRD6S');</script><!--End Google Tag Manager-->
<meta content="IE=Edge" http-equiv="X-UA-Compatible"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>Upgrade Guide — twilio-python 7.15.1 documentation</title>
<link href="_static/alabaster.css" rel="stylesheet" type="text/css"/>
<link href="_static/pygments.css" rel="stylesheet" type="text/css"/>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js" type="text/javascript"></script>
<script src="_static/jquery.js" type="text/javascript"></script>
<script src="_static/underscore.js" type="text/javascript"></script>
<script src="_static/doctools.js" type="text/javascript"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
<link href="genindex.html" rel="index" title="Index"/>
<link href="search.html" rel="search" title="Search"/>
<link href="_static/custom.css" rel="stylesheet" type="text/css"/>
<meta content="width=device-width, initial-scale=0.9, maximum-scale=0.9" name="viewport"/>
</head><body><!--Google Tag Manager (noscript)--><noscript><iframe height="0" src="https://www.googletagmanager.com/ns.html?id=GTM-MWRD6S" style="display:none;visibility:hidden" width="0"></iframe></noscript><!--End Google Tag Manager (noscript)-->
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="upgrade-guide">
<h1>Upgrade Guide<a class="headerlink" href="#upgrade-guide" title="Permalink to this headline">¶</a></h1>
<p><em><code class="docutils literal notranslate"><span class="pre">MAJOR</span></code> version bumps will have upgrade notes
posted here.</em></p>
<div class="section" id="x-x-to-7-x-x">
<h2>[2021-09-22] 6.x.x to 7.x.x<a class="headerlink" href="#x-x-to-7-x-x" title="Permalink to this headline">¶</a></h2>
<div class="section" id="overview">
<h3>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h3>
<p>Version <code class="docutils literal notranslate"><span class="pre">7.x.x</span></code> is the first version that officially drops support for Python versions 2.7, 3.4, and 3.5.</p>
<div class="section" id="removal-of-files-and-dependencies-that-were-added-to-support-python-2-7-3-4-and-3-5">
<h4>Removal of files and dependencies that were added to support Python 2.7, 3.4, and 3.5:<a class="headerlink" href="#removal-of-files-and-dependencies-that-were-added-to-support-python-2-7-3-4-and-3-5" title="Permalink to this headline">¶</a></h4>
<ul class="simple">
<li><a class="reference external" href="https://github.com/twilio/twilio-python/pull/560/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552L4">Six</a><ul>
<li>Removed use of <code class="docutils literal notranslate"><span class="pre">u</span></code> a fake unicode literal</li>
<li>Removed use of <code class="docutils literal notranslate"><span class="pre">b</span></code> a fake bytes literal</li>
<li>Removed <code class="docutils literal notranslate"><span class="pre">PY3</span></code> a boolean indicating if the code is running on Python 3</li>
<li><code class="docutils literal notranslate"><span class="pre">text_type</span></code> type for representing (Unicode) textual data –> <code class="docutils literal notranslate"><span class="pre">str</span></code></li>
<li><code class="docutils literal notranslate"><span class="pre">iteritems</span></code> returns an iterator over dictionary’s items –> <code class="docutils literal notranslate"><span class="pre">items</span></code></li>
<li><code class="docutils literal notranslate"><span class="pre">string_types</span></code> possible types for text data like basestring() in Python 2 and str in Python 3.–> <code class="docutils literal notranslate"><span class="pre">str</span></code></li>
</ul>
</li>
<li><a class="reference external" href="https://github.com/twilio/twilio-python/pull/560/files?file-filters%5B%5D=.md&file-filters%5B%5D=.py&file-filters%5B%5D=.toml&file-filters%5B%5D=.txt&file-filters%5B%5D=.yml&file-filters%5B%5D=No+extension#diff-e327449701a8717c94e1a084cdfc7dbf334c634cddf3867058b8f991d2de52c1L1">twilio/compat.py</a><ul>
<li><code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">twilio.compat</span> <span class="pre">import</span> <span class="pre">urlencode</span></code> –> <code class="docutils literal notranslate"><span class="pre">from</span> <span class="pre">urllib.parse</span> <span class="pre">import</span> <span class="pre">urlencode</span></code></li>
<li><code class="docutils literal notranslate"><span class="pre">izip</span></code> –> <code class="docutils literal notranslate"><span class="pre">zip</span></code></li>
</ul>
</li>
<li><a class="reference external" href="https://github.com/twilio/twilio-python/pull/560/files?file-filters%5B%5D=.md&file-filters%5B%5D=.py&file-filters%5B%5D=.toml&file-filters%5B%5D=.txt&file-filters%5B%5D=.yml&file-filters%5B%5D=No+extension#diff-03276a6bdd4ecdf37ab6bedf60032dd05f640e1b470e4353badc787d80ba73d5L1">twilio/jwt/compat.py</a><ul>
<li>Removed <code class="docutils literal notranslate"><span class="pre">compat.compare_digest</span></code></li>
</ul>
</li>
<li><a class="reference external" href="https://github.com/twilio/twilio-python/pull/560/files?file-filters%5B%5D=.ini&file-filters%5B%5D=.py&file-filters%5B%5D=.yml#diff-9152dd65476e69cc34a307781d5cef195070f48da5670ed0934fd34a9ac91150L12-L16">twilio/jwt/<strong>init</strong>.py</a><ul>
<li>Removed import for <code class="docutils literal notranslate"><span class="pre">simplejson</span></code> and <code class="docutils literal notranslate"><span class="pre">json</span></code></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="updated-dependencies">
<h4>Updated dependencies<a class="headerlink" href="#updated-dependencies" title="Permalink to this headline">¶</a></h4>
<ul class="simple">
<li><a class="reference external" href="https://github.com/twilio/twilio-python/pull/560/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552L6">Updated PyJWT to >=2.0.0</a></li>
</ul>
</div>
</div>
<div class="section" id="changed-remove-the-ability-to-override-the-algorithm-in-jwt-to-jwt">
<h3>CHANGED - <a class="reference external" href="https://github.com/twilio/twilio-python/pull/560/commits/dab158f429015e0894217d6503f55b517c27c474">Remove the ability to override the <code class="docutils literal notranslate"><span class="pre">algorithm</span></code> in <code class="docutils literal notranslate"><span class="pre">Jwt.to_jwt()</span></code></a>.<a class="headerlink" href="#changed-remove-the-ability-to-override-the-algorithm-in-jwt-to-jwt" title="Permalink to this headline">¶</a></h3>
<div class="section" id="removed-the-ability-to-override-the-algorithm-while-using-a-jwt-access-token">
<h4>Removed the ability to override the algorithm while using a jwt access token:<a class="headerlink" href="#removed-the-ability-to-override-the-algorithm-while-using-a-jwt-access-token" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="o">//</span> <span class="mf">6.</span><span class="n">x</span><span class="o">.</span><span class="n">x</span>
<span class="kn">from</span> <span class="nn">twilio.jwt.access_token</span> <span class="kn">import</span> <span class="n">AccessToken</span>
<span class="n">token</span><span class="o">.</span><span class="n">to_jwt</span><span class="p">(</span><span class="n">algorithm</span><span class="o">=</span><span class="s1">'HS512'</span><span class="p">)</span>
</pre></div>
</div>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="o">//</span> <span class="mf">7.</span><span class="n">x</span><span class="o">.</span><span class="n">x</span>
<span class="kn">from</span> <span class="nn">twilio.jwt.access_token</span> <span class="kn">import</span> <span class="n">AccessToken</span>
<span class="n">token</span><span class="o">.</span><span class="n">to_jwt</span><span class="p">()</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="x-to-6-7-x">
<h2>[2017-09-28] 6.6.x to 6.7.x<a class="headerlink" href="#x-to-6-7-x" title="Permalink to this headline">¶</a></h2>
<div class="section" id="changed-body-parameter-on-chat-message-creation-is-no-longer-required">
<h3>CHANGED - <code class="docutils literal notranslate"><span class="pre">Body</span></code> parameter on Chat <code class="docutils literal notranslate"><span class="pre">Message</span></code> creation is no longer required.<a class="headerlink" href="#changed-body-parameter-on-chat-message-creation-is-no-longer-required" title="Permalink to this headline">¶</a></h3>
<div class="section" id="rationale">
<h4>Rationale<a class="headerlink" href="#rationale" title="Permalink to this headline">¶</a></h4>
<p>This was changed to add support for sending media in Chat messages, users can now either provide a <code class="docutils literal notranslate"><span class="pre">body</span></code> or a <code class="docutils literal notranslate"><span class="pre">media_sid</span></code>.</p>
</div>
<div class="section" id="x">
<h4>6.6.x<a class="headerlink" href="#x" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">twilio.rest</span> <span class="kn">import</span> <span class="n">Client</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="s1">'AC123'</span><span class="p">,</span> <span class="s1">'auth'</span><span class="p">)</span>
<span class="n">client</span><span class="o">.</span><span class="n">chat</span><span class="o">.</span><span class="n">v2</span><span class="o">.</span><span class="n">services</span><span class="p">(</span><span class="s1">'IS123'</span><span class="p">)</span><span class="o">.</span><span class="n">channels</span><span class="p">(</span><span class="s1">'CH123'</span><span class="p">)</span><span class="o">.</span><span class="n">messages</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="s2">"this is the body"</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="x-1">
<h4>6.7.x<a class="headerlink" href="#x-1" title="Permalink to this headline">¶</a></h4>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">twilio.rest</span> <span class="kn">import</span> <span class="n">Client</span>
<span class="n">client</span> <span class="o">=</span> <span class="n">Client</span><span class="p">(</span><span class="s1">'AC123'</span><span class="p">,</span> <span class="s1">'auth'</span><span class="p">)</span>
<span class="n">client</span><span class="o">.</span><span class="n">chat</span><span class="o">.</span><span class="n">v2</span><span class="o">.</span><span class="n">services</span><span class="p">(</span><span class="s1">'IS123'</span><span class="p">)</span><span class="o">.</span><span class="n">channels</span><span class="p">(</span><span class="s1">'CH123'</span><span class="p">)</span><span class="o">.</span><span class="n">messages</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">body</span><span class="o">=</span><span class="s2">"this is the body"</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div aria-label="main navigation" class="sphinxsidebar" role="navigation">
<div class="sphinxsidebarwrapper"><h3><a href="https://www.twilio.com/docs/libraries/python">About twilio-python</a></h3>
<p>
A Python module for communicating with the Twilio API and generating <a href="http://www.twilio.com/docs/api/twiml/">TwiML</a>.
</p>
<h3>Useful Links</h3>
<ul>
<li><a href="https://www.twilio.com/docs/libraries/python">Twilio's Python Helper Library Docs</a></li>
<li><a href="https://pypi.org/project/twilio/">twilio @ PyPI</a></li>
<li><a href="https://github.com/twilio/twilio-python">twilio-python @ GitHub</a></li>
</ul>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Upgrade Guide</a><ul>
<li><a class="reference internal" href="#x-x-to-7-x-x">[2021-09-22] 6.x.x to 7.x.x</a><ul>
<li><a class="reference internal" href="#overview">Overview</a><ul>
<li><a class="reference internal" href="#removal-of-files-and-dependencies-that-were-added-to-support-python-2-7-3-4-and-3-5">Removal of files and dependencies that were added to support Python 2.7, 3.4, and 3.5:</a></li>
<li><a class="reference internal" href="#updated-dependencies">Updated dependencies</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changed-remove-the-ability-to-override-the-algorithm-in-jwt-to-jwt">CHANGED - Remove the ability to override the <code class="docutils literal notranslate"><span class="pre">algorithm</span></code> in <code class="docutils literal notranslate"><span class="pre">Jwt.to_jwt()</span></code>.</a><ul>
<li><a class="reference internal" href="#removed-the-ability-to-override-the-algorithm-while-using-a-jwt-access-token">Removed the ability to override the algorithm while using a jwt access token:</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#x-to-6-7-x">[2017-09-28] 6.6.x to 6.7.x</a><ul>
<li><a class="reference internal" href="#changed-body-parameter-on-chat-message-creation-is-no-longer-required">CHANGED - <code class="docutils literal notranslate"><span class="pre">Body</span></code> parameter on Chat <code class="docutils literal notranslate"><span class="pre">Message</span></code> creation is no longer required.</a><ul>
<li><a class="reference internal" href="#rationale">Rationale</a></li>
<li><a class="reference internal" href="#x">6.6.x</a></li>
<li><a class="reference internal" href="#x-1">6.7.x</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div aria-label="source link" role="note">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/UPGRADE.md.txt" rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" role="search" style="display: none">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form action="search.html" class="search" method="get">
<input name="q" type="text"/>
<input type="submit" value="Go"/>
<input name="check_keywords" type="hidden" value="yes"/>
<input name="area" type="hidden" value="default"/>
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2019, Twilio.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.0</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/UPGRADE.md.txt" rel="nofollow">Page source</a>
</div>
</body>
</html>