Show More
@@ -1,302 +1,343 | |||
|
1 | 1 | ============ |
|
2 | 2 | 5.x Series |
|
3 | 3 | ============ |
|
4 | 4 | |
|
5 | 5 | IPython 5.4 |
|
6 | 6 | =========== |
|
7 | 7 | |
|
8 | IPython 5.4-LTS is the first release of IPython after the release of the 6.x | |
|
9 | series which is Python 3 only. It backports most of the new exposed API | |
|
10 | additions made in IPython 6.0 and 6.1 and avoid having to write conditional | |
|
11 | logics depending of the version of IPython. | |
|
12 | ||
|
13 | Please upgrade to pip 9 or greater before upgrading IPython. | |
|
14 | Failing to do so on Python 2 may lead to a broken IPython install. | |
|
15 | ||
|
8 | 16 | Configurable TerminalInteractiveShell |
|
9 | 17 | ------------------------------------- |
|
10 | 18 | |
|
11 | 19 | Backported from the 6.x branch as an exceptional new feature. See |
|
12 | 20 | :ghpull:`10373` and :ghissue:`10364` |
|
13 | 21 | |
|
14 | 22 | IPython gained a new ``c.TerminalIPythonApp.interactive_shell_class`` option |
|
15 | 23 | that allow to customize the class used to start the terminal frontend. This |
|
16 | 24 | should allow user to use custom interfaces, like reviving the former readline |
|
17 | 25 | interface which is now a separate package not maintained by the core team. |
|
18 | 26 | |
|
27 | Define ``_repr_mimebundle_`` | |
|
28 | ---------------------------- | |
|
29 | ||
|
30 | Object can now define `_repr_mimebundle_` in place of multiple `_repr_*_` | |
|
31 | methods and return a full mimebundle. This greatly simplify many implementation | |
|
32 | and allow to publish custom mimetypes (like geojson, plotly, dataframes....). | |
|
33 | See the ``Cutom Display Logic`` example notebook for more informations. | |
|
34 | ||
|
35 | Execution Heuristics | |
|
36 | -------------------- | |
|
37 | ||
|
38 | The heuristic for execution in the command line interface is now more biased | |
|
39 | toward executing for single statement. While in IPython 4.x and before a single | |
|
40 | line would be executed when enter is pressed, IPython 5.x would insert a new | |
|
41 | line. For single line statement this is not true anymore and if a single line is | |
|
42 | valid Python, IPython will execute it regardless of the cursor position. Use | |
|
43 | :kbd:`Ctrl-O` to insert a new line. :ghpull:`10489` | |
|
44 | ||
|
45 | ||
|
46 | Implement Display IDs | |
|
47 | --------------------- | |
|
48 | ||
|
49 | Implement display id and ability to update a given display. This should greatly | |
|
50 | simplify a lot of code by removing the need for widgets and allow other frontend | |
|
51 | to implement things like progress-bars. See :ghpull:`10048` | |
|
52 | ||
|
53 | Miscs | |
|
54 | ----- | |
|
19 | 55 | |
|
56 | * ``_mp_main_`` is not reloaded which fixes issues with multiprocessing. | |
|
57 | :ghpull:`10523` | |
|
58 | * Use user colorscheme in Pdb as well :ghpull:`10479` | |
|
59 | * Faster shutdown. :ghpull:`10408` | |
|
60 | * Fix a crash in reverse search. :ghpull:`10371` | |
|
20 | 61 | * added ``Completer.backslash_combining_completions`` boolean option to |
|
21 | 62 | deactivate backslash-tab completion that may conflict with windows path. |
|
22 | 63 | |
|
23 | 64 | IPython 5.3 |
|
24 | 65 | =========== |
|
25 | 66 | |
|
26 | 67 | Released on February 24th, 2017. Remarkable changes and fixes: |
|
27 | 68 | |
|
28 | 69 | * Fix a bug in ``set_next_input`` leading to a crash of terminal IPython. |
|
29 | 70 | :ghpull:`10231`, :ghissue:`10296`, :ghissue:`10229` |
|
30 | 71 | * Always wait for editor inputhook for terminal IPython :ghpull:`10239`, |
|
31 | 72 | :ghpull:`10240` |
|
32 | 73 | * Disable ``_ipython_display_`` in terminal :ghpull:`10249`, :ghpull:`10274` |
|
33 | 74 | * Update terminal colors to be more visible by default on windows |
|
34 | 75 | :ghpull:`10260`, :ghpull:`10238`, :ghissue:`10281` |
|
35 | 76 | * Add Ctrl-Z shortcut (suspend) in terminal debugger :ghpull:`10254`, |
|
36 | 77 | :ghissue:`10273` |
|
37 | 78 | * Indent on new line by looking at the text before the cursor :ghpull:`10264`, |
|
38 | 79 | :ghpull:`10275`, :ghissue:`9283` |
|
39 | 80 | * Update QtEventloop integration to fix some matplotlib integration issues |
|
40 | 81 | :ghpull:`10201`, :ghpull:`10311`, :ghissue:`10201` |
|
41 | 82 | * Respect completions display style in terminal debugger :ghpull:`10305`, |
|
42 | 83 | :ghpull:`10313` |
|
43 | 84 | * Add a config option ``TerminalInteractiveShell.extra_open_editor_shortcuts`` |
|
44 | 85 | to enable extra shortcuts to open the input in an editor. These are :kbd:`v` |
|
45 | 86 | in vi mode, and :kbd:`C-X C-E` in emacs mode (:ghpull:`10330`). |
|
46 | 87 | The :kbd:`F2` shortcut is always enabled. |
|
47 | 88 | |
|
48 | 89 | IPython 5.2.2 |
|
49 | 90 | ============= |
|
50 | 91 | |
|
51 | 92 | * Fix error when starting with ``IPCompleter.limit_to__all__`` configured. |
|
52 | 93 | |
|
53 | 94 | IPython 5.2.1 |
|
54 | 95 | ============= |
|
55 | 96 | |
|
56 | 97 | * Fix tab completion in the debugger. :ghpull:`10223` |
|
57 | 98 | |
|
58 | 99 | IPython 5.2 |
|
59 | 100 | =========== |
|
60 | 101 | |
|
61 | 102 | Released on January 29th, 2017. Remarkable changes and fixes: |
|
62 | 103 | |
|
63 | 104 | * restore IPython's debugger to raise on quit. :ghpull:`10009` |
|
64 | 105 | * The configuration value ``c.TerminalInteractiveShell.highlighting_style`` can |
|
65 | 106 | now directly take a class argument for custom color style. :ghpull:`9848` |
|
66 | 107 | * Correctly handle matplotlib figures dpi :ghpull:`9868` |
|
67 | 108 | * Deprecate ``-e`` flag for the ``%notebook`` magic that had no effects. |
|
68 | 109 | :ghpull:`9872` |
|
69 | 110 | * You can now press F2 while typing at a terminal prompt to edit the contents |
|
70 | 111 | in your favourite terminal editor. Set the :envvar:`EDITOR` environment |
|
71 | 112 | variable to pick which editor is used. :ghpull:`9929` |
|
72 | 113 | * sdists will now only be ``.tar.gz`` as per upstream PyPI requirements. |
|
73 | 114 | :ghpull:`9925` |
|
74 | 115 | * :any:`IPython.core.debugger` have gained a ``set_trace()`` method for |
|
75 | 116 | convenience. :ghpull:`9947` |
|
76 | 117 | * The 'smart command mode' added to the debugger in 5.0 was removed, as more |
|
77 | 118 | people preferred the previous behaviour. Therefore, debugger commands such as |
|
78 | 119 | ``c`` will act as debugger commands even when ``c`` is defined as a variable. |
|
79 | 120 | :ghpull:`10050` |
|
80 | 121 | * Fixes OS X event loop issues at startup, :ghpull:`10150` |
|
81 | 122 | * Deprecate the ``%autoindent`` magic. :ghpull:`10176` |
|
82 | 123 | * Emit a :any:`DeprecationWarning` when setting the deprecated |
|
83 | 124 | ``limit_to_all`` option of the completer. :ghpull:`10198` |
|
84 | 125 | * The :cellmagic:`capture` magic can now capture the result of a cell (from an |
|
85 | 126 | expression on the last line), as well as printed and displayed output. |
|
86 | 127 | :ghpull:`9851`. |
|
87 | 128 | |
|
88 | 129 | |
|
89 | 130 | Changes of behavior to :any:`InteractiveShellEmbed`. |
|
90 | 131 | |
|
91 | 132 | :any:`InteractiveShellEmbed` interactive behavior have changed a bit in between |
|
92 | 133 | 5.1 and 5.2. By default ``%kill_embedded`` magic will prevent further invocation |
|
93 | 134 | of the current ``call location`` instead of preventing further invocation of |
|
94 | 135 | the current instance creation location. For most use case this will not change |
|
95 | 136 | much for you, though previous behavior was confusing and less consistent with |
|
96 | 137 | previous IPython versions. |
|
97 | 138 | |
|
98 | 139 | You can now deactivate instances by using ``%kill_embedded --instance`` flag, |
|
99 | 140 | (or ``-i`` in short). The ``%kill_embedded`` magic also gained a |
|
100 | 141 | ``--yes``/``-y`` option which skip confirmation step, and ``-x``/``--exit`` |
|
101 | 142 | which also exit the current embedded call without asking for confirmation. |
|
102 | 143 | |
|
103 | 144 | See :ghpull:`10207`. |
|
104 | 145 | |
|
105 | 146 | |
|
106 | 147 | |
|
107 | 148 | IPython 5.1 |
|
108 | 149 | =========== |
|
109 | 150 | |
|
110 | 151 | * Broken ``%timeit`` on Python2 due to the use of ``__qualname__``. :ghpull:`9804` |
|
111 | 152 | * Restore ``%gui qt`` to create and return a ``QApplication`` if necessary. :ghpull:`9789` |
|
112 | 153 | * Don't set terminal title by default. :ghpull:`9801` |
|
113 | 154 | * Preserve indentation when inserting newlines with ``Ctrl-O``. :ghpull:`9770` |
|
114 | 155 | * Restore completion in debugger. :ghpull:`9785` |
|
115 | 156 | * Deprecate ``IPython.core.debugger.Tracer()`` in favor of simpler, newer, APIs. :ghpull:`9731` |
|
116 | 157 | * Restore ``NoOpContext`` context manager removed by mistake, and add `DeprecationWarning`. :ghpull:`9765` |
|
117 | 158 | * Add option allowing ``Prompt_toolkit`` to use 24bits colors. :ghpull:`9736` |
|
118 | 159 | * Fix for closing interactive matplotlib windows on OS X. :ghpull:`9854` |
|
119 | 160 | * An embedded interactive shell instance can be used more than once. :ghpull:`9843` |
|
120 | 161 | * More robust check for whether IPython is in a terminal. :ghpull:`9833` |
|
121 | 162 | * Better pretty-printing of dicts on PyPy. :ghpull:`9827` |
|
122 | 163 | * Some coloured output now looks better on dark background command prompts in Windows. |
|
123 | 164 | :ghpull:`9838` |
|
124 | 165 | * Improved tab completion of paths on Windows . :ghpull:`9826` |
|
125 | 166 | * Fix tkinter event loop integration on Python 2 with ``future`` installed. :ghpull:`9824` |
|
126 | 167 | * Restore ``Ctrl-\`` as a shortcut to quit IPython. |
|
127 | 168 | * Make ``get_ipython()`` accessible when modules are imported by startup files. :ghpull:`9818` |
|
128 | 169 | * Add support for running directories containing a ``__main__.py`` file with the |
|
129 | 170 | ``ipython`` command. :ghpull:`9813` |
|
130 | 171 | |
|
131 | 172 | |
|
132 | 173 | True Color feature |
|
133 | 174 | ------------------ |
|
134 | 175 | |
|
135 | 176 | ``prompt_toolkit`` uses pygments styles for syntax highlighting. By default, the |
|
136 | 177 | colors specified in the style are approximated using a standard 256-color |
|
137 | 178 | palette. ``prompt_toolkit`` also supports 24bit, a.k.a. "true", a.k.a. 16-million |
|
138 | 179 | color escape sequences which enable compatible terminals to display the exact |
|
139 | 180 | colors specified instead of an approximation. This true_color option exposes |
|
140 | 181 | that capability in prompt_toolkit to the IPython shell. |
|
141 | 182 | |
|
142 | 183 | Here is a good source for the current state of true color support in various |
|
143 | 184 | terminal emulators and software projects: https://gist.github.com/XVilka/8346728 |
|
144 | 185 | |
|
145 | 186 | |
|
146 | 187 | |
|
147 | 188 | IPython 5.0 |
|
148 | 189 | =========== |
|
149 | 190 | |
|
150 | 191 | Released July 7, 2016 |
|
151 | 192 | |
|
152 | 193 | New terminal interface |
|
153 | 194 | ---------------------- |
|
154 | 195 | |
|
155 | 196 | IPython 5 features a major upgrade to the terminal interface, bringing live |
|
156 | 197 | syntax highlighting as you type, proper multiline editing and multiline paste, |
|
157 | 198 | and tab completions that don't clutter up your history. |
|
158 | 199 | |
|
159 | 200 | .. image:: ../_images/ptshell_features.png |
|
160 | 201 | :alt: New terminal interface features |
|
161 | 202 | :align: center |
|
162 | 203 | :target: ../_images/ptshell_features.png |
|
163 | 204 | |
|
164 | 205 | These features are provided by the Python library `prompt_toolkit |
|
165 | 206 | <http://python-prompt-toolkit.readthedocs.io/en/stable/>`__, which replaces |
|
166 | 207 | ``readline`` throughout our terminal interface. |
|
167 | 208 | |
|
168 | 209 | Relying on this pure-Python, cross platform module also makes it simpler to |
|
169 | 210 | install IPython. We have removed dependencies on ``pyreadline`` for Windows and |
|
170 | 211 | ``gnureadline`` for Mac. |
|
171 | 212 | |
|
172 | 213 | Backwards incompatible changes |
|
173 | 214 | ------------------------------ |
|
174 | 215 | |
|
175 | 216 | - The ``%install_ext`` magic function, deprecated since 4.0, has now been deleted. |
|
176 | 217 | You can distribute and install extensions as packages on PyPI. |
|
177 | 218 | - Callbacks registered while an event is being handled will now only be called |
|
178 | 219 | for subsequent events; previously they could be called for the current event. |
|
179 | 220 | Similarly, callbacks removed while handling an event *will* always get that |
|
180 | 221 | event. See :ghissue:`9447` and :ghpull:`9453`. |
|
181 | 222 | - Integration with pydb has been removed since pydb development has been stopped |
|
182 | 223 | since 2012, and pydb is not installable from PyPI. |
|
183 | 224 | - The ``autoedit_syntax`` option has apparently been broken for many years. |
|
184 | 225 | It has been removed. |
|
185 | 226 | |
|
186 | 227 | New terminal interface |
|
187 | 228 | ~~~~~~~~~~~~~~~~~~~~~~ |
|
188 | 229 | |
|
189 | 230 | The overhaul of the terminal interface will probably cause a range of minor |
|
190 | 231 | issues for existing users. |
|
191 | 232 | This is inevitable for such a significant change, and we've done our best to |
|
192 | 233 | minimise these issues. |
|
193 | 234 | Some changes that we're aware of, with suggestions on how to handle them: |
|
194 | 235 | |
|
195 | 236 | IPython no longer uses readline configuration (``~/.inputrc``). We hope that |
|
196 | 237 | the functionality you want (e.g. vi input mode) will be available by configuring |
|
197 | 238 | IPython directly (see :doc:`/config/options/terminal`). |
|
198 | 239 | If something's missing, please file an issue. |
|
199 | 240 | |
|
200 | 241 | The ``PromptManager`` class has been removed, and the prompt machinery simplified. |
|
201 | 242 | See :ref:`custom_prompts` to customise prompts with the new machinery. |
|
202 | 243 | |
|
203 | 244 | :mod:`IPython.core.debugger` now provides a plainer interface. |
|
204 | 245 | :mod:`IPython.terminal.debugger` contains the terminal debugger using |
|
205 | 246 | prompt_toolkit. |
|
206 | 247 | |
|
207 | 248 | There are new options to configure the colours used in syntax highlighting. |
|
208 | 249 | We have tried to integrate them with our classic ``--colors`` option and |
|
209 | 250 | ``%colors`` magic, but there's a mismatch in possibilities, so some configurations |
|
210 | 251 | may produce unexpected results. See :ref:`termcolour` for more information. |
|
211 | 252 | |
|
212 | 253 | The new interface is not compatible with Emacs 'inferior-shell' feature. To |
|
213 | 254 | continue using this, add the ``--simple-prompt`` flag to the command Emacs |
|
214 | 255 | runs. This flag disables most IPython features, relying on Emacs to provide |
|
215 | 256 | things like tab completion. |
|
216 | 257 | |
|
217 | 258 | Provisional Changes |
|
218 | 259 | ------------------- |
|
219 | 260 | |
|
220 | 261 | Provisional changes are experimental functionality that may, or may not, make |
|
221 | 262 | it into a future version of IPython, and which API may change without warnings. |
|
222 | 263 | Activating these features and using these API are at your own risk, and may have |
|
223 | 264 | security implication for your system, especially if used with the Jupyter notebook, |
|
224 | 265 | |
|
225 | 266 | When running via the Jupyter notebook interfaces, or other compatible client, |
|
226 | 267 | you can enable rich documentation experimental functionality: |
|
227 | 268 | |
|
228 | 269 | When the ``docrepr`` package is installed setting the boolean flag |
|
229 | 270 | ``InteractiveShell.sphinxify_docstring`` to ``True``, will process the various |
|
230 | 271 | object through sphinx before displaying them (see the ``docrepr`` package |
|
231 | 272 | documentation for more information. |
|
232 | 273 | |
|
233 | 274 | You need to also enable the IPython pager display rich HTML representation |
|
234 | 275 | using the ``InteractiveShell.enable_html_pager`` boolean configuration option. |
|
235 | 276 | As usual you can set these configuration options globally in your configuration |
|
236 | 277 | files, alternatively you can turn them on dynamically using the following |
|
237 | 278 | snippet: |
|
238 | 279 | |
|
239 | 280 | .. code-block:: python |
|
240 | 281 | |
|
241 | 282 | ip = get_ipython() |
|
242 | 283 | ip.sphinxify_docstring = True |
|
243 | 284 | ip.enable_html_pager = True |
|
244 | 285 | |
|
245 | 286 | |
|
246 | 287 | You can test the effect of various combinations of the above configuration in |
|
247 | 288 | the Jupyter notebook, with things example like : |
|
248 | 289 | |
|
249 | 290 | .. code-block:: ipython |
|
250 | 291 | |
|
251 | 292 | import numpy as np |
|
252 | 293 | np.histogram? |
|
253 | 294 | |
|
254 | 295 | |
|
255 | 296 | This is part of an effort to make Documentation in Python richer and provide in |
|
256 | 297 | the long term if possible dynamic examples that can contain math, images, |
|
257 | 298 | widgets... As stated above this is nightly experimental feature with a lot of |
|
258 | 299 | (fun) problem to solve. We would be happy to get your feedback and expertise on |
|
259 | 300 | it. |
|
260 | 301 | |
|
261 | 302 | |
|
262 | 303 | |
|
263 | 304 | Deprecated Features |
|
264 | 305 | ------------------- |
|
265 | 306 | |
|
266 | 307 | Some deprecated features are listed in this section. Don't forget to enable |
|
267 | 308 | ``DeprecationWarning`` as an error if you are using IPython in a Continuous |
|
268 | 309 | Integration setup or in your testing in general: |
|
269 | 310 | |
|
270 | 311 | .. code-block:: python |
|
271 | 312 | |
|
272 | 313 | import warnings |
|
273 | 314 | warnings.filterwarnings('error', '.*', DeprecationWarning, module='yourmodule.*') |
|
274 | 315 | |
|
275 | 316 | |
|
276 | 317 | - ``hooks.fix_error_editor`` seems unused and is pending deprecation. |
|
277 | 318 | - `IPython/core/excolors.py:ExceptionColors` is deprecated. |
|
278 | 319 | - `IPython.core.InteractiveShell:write()` is deprecated; use `sys.stdout` instead. |
|
279 | 320 | - `IPython.core.InteractiveShell:write_err()` is deprecated; use `sys.stderr` instead. |
|
280 | 321 | - The `formatter` keyword argument to `Inspector.info` in `IPython.core.oinspec` has no effect. |
|
281 | 322 | - The `global_ns` keyword argument of IPython Embed was deprecated, and has no effect. Use `module` keyword argument instead. |
|
282 | 323 | |
|
283 | 324 | |
|
284 | 325 | Known Issues: |
|
285 | 326 | ------------- |
|
286 | 327 | |
|
287 | 328 | - ``<Esc>`` Key does not dismiss the completer and does not clear the current |
|
288 | 329 | buffer. This is an on purpose modification due to current technical |
|
289 | 330 | limitation. Cf :ghpull:`9572`. Escape the control character which is used |
|
290 | 331 | for other shortcut, and there is no practical way to distinguish. Use Ctr-G |
|
291 | 332 | or Ctrl-C as an alternative. |
|
292 | 333 | |
|
293 | 334 | - Cannot use ``Shift-Enter`` and ``Ctrl-Enter`` to submit code in terminal. cf |
|
294 | 335 | :ghissue:`9587` and :ghissue:`9401`. In terminal there is no practical way to |
|
295 | 336 | distinguish these key sequences from a normal new line return. |
|
296 | 337 | |
|
297 | 338 | - ``PageUp`` and ``pageDown`` do not move through completion menu. |
|
298 | 339 | |
|
299 | 340 | - Color styles might not adapt to terminal emulator themes. This will need new |
|
300 | 341 | version of Pygments to be released, and can be mitigated with custom themes. |
|
301 | 342 | |
|
302 | 343 |
General Comments 0
You need to be logged in to leave comments.
Login now