Show More
@@ -1,273 +1,282 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | # |
|
2 | # | |
3 | # IPython documentation build configuration file. |
|
3 | # IPython documentation build configuration file. | |
4 |
|
4 | |||
5 | # NOTE: This file has been edited manually from the auto-generated one from |
|
5 | # NOTE: This file has been edited manually from the auto-generated one from | |
6 | # sphinx. Do NOT delete and re-generate. If any changes from sphinx are |
|
6 | # sphinx. Do NOT delete and re-generate. If any changes from sphinx are | |
7 | # needed, generate a scratch one and merge by hand any new fields needed. |
|
7 | # needed, generate a scratch one and merge by hand any new fields needed. | |
8 |
|
8 | |||
9 | # |
|
9 | # | |
10 | # This file is execfile()d with the current directory set to its containing dir. |
|
10 | # This file is execfile()d with the current directory set to its containing dir. | |
11 | # |
|
11 | # | |
12 | # The contents of this file are pickled, so don't put values in the namespace |
|
12 | # The contents of this file are pickled, so don't put values in the namespace | |
13 | # that aren't pickleable (module imports are okay, they're removed automatically). |
|
13 | # that aren't pickleable (module imports are okay, they're removed automatically). | |
14 | # |
|
14 | # | |
15 | # All configuration values have a default value; values that are commented out |
|
15 | # All configuration values have a default value; values that are commented out | |
16 | # serve to show the default value. |
|
16 | # serve to show the default value. | |
17 |
|
17 | |||
18 | import sys, os |
|
18 | import sys, os | |
19 |
|
19 | |||
20 | ON_RTD = os.environ.get('READTHEDOCS', None) == 'True' |
|
20 | ON_RTD = os.environ.get('READTHEDOCS', None) == 'True' | |
21 |
|
21 | |||
22 | if ON_RTD: |
|
22 | if ON_RTD: | |
23 | # Mock the presence of matplotlib, which we don't have on RTD |
|
23 | # Mock the presence of matplotlib, which we don't have on RTD | |
24 | # see |
|
24 | # see | |
25 | # http://read-the-docs.readthedocs.io/en/latest/faq.html |
|
25 | # http://read-the-docs.readthedocs.io/en/latest/faq.html | |
26 | tags.add('rtd') |
|
26 | tags.add('rtd') | |
27 |
|
27 | |||
28 | # RTD doesn't use the Makefile, so re-run autogen_{things}.py here. |
|
28 | # RTD doesn't use the Makefile, so re-run autogen_{things}.py here. | |
29 | for name in ('config', 'api', 'magics'): |
|
29 | for name in ('config', 'api', 'magics'): | |
30 | fname = 'autogen_{}.py'.format(name) |
|
30 | fname = 'autogen_{}.py'.format(name) | |
31 | fpath = os.path.abspath(os.path.join('..', fname)) |
|
31 | fpath = os.path.abspath(os.path.join('..', fname)) | |
32 | with open(fpath) as f: |
|
32 | with open(fpath) as f: | |
33 | exec(compile(f.read(), fname, 'exec'), { |
|
33 | exec(compile(f.read(), fname, 'exec'), { | |
34 | '__file__': fpath, |
|
34 | '__file__': fpath, | |
35 | '__name__': '__main__', |
|
35 | '__name__': '__main__', | |
36 | }) |
|
36 | }) | |
37 | else: |
|
37 | else: | |
38 | import sphinx_rtd_theme |
|
38 | import sphinx_rtd_theme | |
39 | html_theme = "sphinx_rtd_theme" |
|
39 | html_theme = "sphinx_rtd_theme" | |
40 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
|
40 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] | |
41 |
|
41 | |||
42 | # If your extensions are in another directory, add it here. If the directory |
|
42 | # If your extensions are in another directory, add it here. If the directory | |
43 | # is relative to the documentation root, use os.path.abspath to make it |
|
43 | # is relative to the documentation root, use os.path.abspath to make it | |
44 | # absolute, like shown here. |
|
44 | # absolute, like shown here. | |
45 | sys.path.insert(0, os.path.abspath('../sphinxext')) |
|
45 | sys.path.insert(0, os.path.abspath('../sphinxext')) | |
46 |
|
46 | |||
47 | # We load the ipython release info into a dict by explicit execution |
|
47 | # We load the ipython release info into a dict by explicit execution | |
48 | iprelease = {} |
|
48 | iprelease = {} | |
49 | exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease) |
|
49 | exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease) | |
50 |
|
50 | |||
51 | # General configuration |
|
51 | # General configuration | |
52 | # --------------------- |
|
52 | # --------------------- | |
53 |
|
53 | |||
54 | # Add any Sphinx extension module names here, as strings. They can be extensions |
|
54 | # Add any Sphinx extension module names here, as strings. They can be extensions | |
55 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
|
55 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | |
56 | extensions = [ |
|
56 | extensions = [ | |
57 | 'matplotlib.sphinxext.mathmpl', |
|
57 | 'matplotlib.sphinxext.mathmpl', | |
58 | 'matplotlib.sphinxext.only_directives', |
|
58 | 'matplotlib.sphinxext.only_directives', | |
59 | 'matplotlib.sphinxext.plot_directive', |
|
59 | 'matplotlib.sphinxext.plot_directive', | |
60 | 'sphinx.ext.autodoc', |
|
60 | 'sphinx.ext.autodoc', | |
61 | 'sphinx.ext.autosummary', |
|
61 | 'sphinx.ext.autosummary', | |
62 | 'sphinx.ext.doctest', |
|
62 | 'sphinx.ext.doctest', | |
63 | 'sphinx.ext.inheritance_diagram', |
|
63 | 'sphinx.ext.inheritance_diagram', | |
64 | 'sphinx.ext.intersphinx', |
|
64 | 'sphinx.ext.intersphinx', | |
65 | 'IPython.sphinxext.ipython_console_highlighting', |
|
65 | 'IPython.sphinxext.ipython_console_highlighting', | |
66 | 'IPython.sphinxext.ipython_directive', |
|
66 | 'IPython.sphinxext.ipython_directive', | |
67 | 'sphinx.ext.napoleon', # to preprocess docstrings |
|
67 | 'sphinx.ext.napoleon', # to preprocess docstrings | |
68 | 'github', # for easy GitHub links |
|
68 | 'github', # for easy GitHub links | |
69 | 'magics', |
|
69 | 'magics', | |
70 | ] |
|
70 | ] | |
71 |
|
71 | |||
72 | if ON_RTD: |
|
72 | if ON_RTD: | |
73 | # Remove extensions not currently supported on RTD |
|
73 | # Remove extensions not currently supported on RTD | |
74 | extensions.remove('matplotlib.sphinxext.only_directives') |
|
74 | extensions.remove('matplotlib.sphinxext.only_directives') | |
75 | extensions.remove('matplotlib.sphinxext.mathmpl') |
|
75 | extensions.remove('matplotlib.sphinxext.mathmpl') | |
76 | extensions.remove('matplotlib.sphinxext.plot_directive') |
|
76 | extensions.remove('matplotlib.sphinxext.plot_directive') | |
77 | extensions.remove('IPython.sphinxext.ipython_directive') |
|
77 | extensions.remove('IPython.sphinxext.ipython_directive') | |
78 | extensions.remove('IPython.sphinxext.ipython_console_highlighting') |
|
78 | extensions.remove('IPython.sphinxext.ipython_console_highlighting') | |
79 |
|
79 | |||
80 | # Add any paths that contain templates here, relative to this directory. |
|
80 | # Add any paths that contain templates here, relative to this directory. | |
81 | templates_path = ['_templates'] |
|
81 | templates_path = ['_templates'] | |
82 |
|
82 | |||
83 | # The suffix of source filenames. |
|
83 | # The suffix of source filenames. | |
84 | source_suffix = '.rst' |
|
84 | source_suffix = '.rst' | |
85 |
|
85 | |||
86 | if iprelease['_version_extra'] == 'dev': |
|
86 | def is_stable(extra): | |
|
87 | for ext in {'dev', 'b', 'rc'}: | |||
|
88 | if ext in extra: | |||
|
89 | return False | |||
|
90 | return True | |||
|
91 | ||||
|
92 | if is_stable(iprelease['_version_extra']): | |||
|
93 | tags.add('ipystable') | |||
|
94 | else: | |||
|
95 | tags.add('ipydev') | |||
87 | rst_prolog = """ |
|
96 | rst_prolog = """ | |
88 |
.. |
|
97 | .. warning:: | |
89 |
|
98 | |||
90 | This documentation is for a development version of IPython. There may be |
|
99 | This documentation is for a development version of IPython. There may be | |
91 | significant differences from the latest stable release. |
|
100 | significant differences from the latest stable release. | |
92 |
|
101 | |||
93 | """ |
|
102 | """ | |
94 |
|
103 | |||
95 | # The master toctree document. |
|
104 | # The master toctree document. | |
96 | master_doc = 'index' |
|
105 | master_doc = 'index' | |
97 |
|
106 | |||
98 | # General substitutions. |
|
107 | # General substitutions. | |
99 | project = 'IPython' |
|
108 | project = 'IPython' | |
100 | copyright = 'The IPython Development Team' |
|
109 | copyright = 'The IPython Development Team' | |
101 |
|
110 | |||
102 | # ghissue config |
|
111 | # ghissue config | |
103 | github_project_url = "https://github.com/ipython/ipython" |
|
112 | github_project_url = "https://github.com/ipython/ipython" | |
104 |
|
113 | |||
105 | # numpydoc config |
|
114 | # numpydoc config | |
106 | numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings |
|
115 | numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings | |
107 | numpydoc_class_members_toctree = False |
|
116 | numpydoc_class_members_toctree = False | |
108 |
|
117 | |||
109 | # The default replacements for |version| and |release|, also used in various |
|
118 | # The default replacements for |version| and |release|, also used in various | |
110 | # other places throughout the built documents. |
|
119 | # other places throughout the built documents. | |
111 | # |
|
120 | # | |
112 | # The full version, including alpha/beta/rc tags. |
|
121 | # The full version, including alpha/beta/rc tags. | |
113 | release = "%s" % iprelease['version'] |
|
122 | release = "%s" % iprelease['version'] | |
114 | # Just the X.Y.Z part, no '-dev' |
|
123 | # Just the X.Y.Z part, no '-dev' | |
115 | version = iprelease['version'].split('-', 1)[0] |
|
124 | version = iprelease['version'].split('-', 1)[0] | |
116 |
|
125 | |||
117 |
|
126 | |||
118 | # There are two options for replacing |today|: either, you set today to some |
|
127 | # There are two options for replacing |today|: either, you set today to some | |
119 | # non-false value, then it is used: |
|
128 | # non-false value, then it is used: | |
120 | #today = '' |
|
129 | #today = '' | |
121 | # Else, today_fmt is used as the format for a strftime call. |
|
130 | # Else, today_fmt is used as the format for a strftime call. | |
122 | today_fmt = '%B %d, %Y' |
|
131 | today_fmt = '%B %d, %Y' | |
123 |
|
132 | |||
124 | # List of documents that shouldn't be included in the build. |
|
133 | # List of documents that shouldn't be included in the build. | |
125 | #unused_docs = [] |
|
134 | #unused_docs = [] | |
126 |
|
135 | |||
127 | # Exclude these glob-style patterns when looking for source files. They are |
|
136 | # Exclude these glob-style patterns when looking for source files. They are | |
128 | # relative to the source/ directory. |
|
137 | # relative to the source/ directory. | |
129 | exclude_patterns = ['whatsnew/pr'] |
|
138 | exclude_patterns = ['whatsnew/pr'] | |
130 |
|
139 | |||
131 |
|
140 | |||
132 | # If true, '()' will be appended to :func: etc. cross-reference text. |
|
141 | # If true, '()' will be appended to :func: etc. cross-reference text. | |
133 | #add_function_parentheses = True |
|
142 | #add_function_parentheses = True | |
134 |
|
143 | |||
135 | # If true, the current module name will be prepended to all description |
|
144 | # If true, the current module name will be prepended to all description | |
136 | # unit titles (such as .. function::). |
|
145 | # unit titles (such as .. function::). | |
137 | #add_module_names = True |
|
146 | #add_module_names = True | |
138 |
|
147 | |||
139 | # If true, sectionauthor and moduleauthor directives will be shown in the |
|
148 | # If true, sectionauthor and moduleauthor directives will be shown in the | |
140 | # output. They are ignored by default. |
|
149 | # output. They are ignored by default. | |
141 | #show_authors = False |
|
150 | #show_authors = False | |
142 |
|
151 | |||
143 | # The name of the Pygments (syntax highlighting) style to use. |
|
152 | # The name of the Pygments (syntax highlighting) style to use. | |
144 | pygments_style = 'sphinx' |
|
153 | pygments_style = 'sphinx' | |
145 |
|
154 | |||
146 | # Set the default role so we can use `foo` instead of ``foo`` |
|
155 | # Set the default role so we can use `foo` instead of ``foo`` | |
147 | default_role = 'literal' |
|
156 | default_role = 'literal' | |
148 |
|
157 | |||
149 | # Options for HTML output |
|
158 | # Options for HTML output | |
150 | # ----------------------- |
|
159 | # ----------------------- | |
151 |
|
160 | |||
152 | # The style sheet to use for HTML and HTML Help pages. A file of that name |
|
161 | # The style sheet to use for HTML and HTML Help pages. A file of that name | |
153 | # must exist either in Sphinx' static/ path, or in one of the custom paths |
|
162 | # must exist either in Sphinx' static/ path, or in one of the custom paths | |
154 | # given in html_static_path. |
|
163 | # given in html_static_path. | |
155 | # html_style = 'default.css' |
|
164 | # html_style = 'default.css' | |
156 | html_favicon = 'favicon.ico' |
|
165 | html_favicon = 'favicon.ico' | |
157 |
|
166 | |||
158 | # The name for this set of Sphinx documents. If None, it defaults to |
|
167 | # The name for this set of Sphinx documents. If None, it defaults to | |
159 | # "<project> v<release> documentation". |
|
168 | # "<project> v<release> documentation". | |
160 | #html_title = None |
|
169 | #html_title = None | |
161 |
|
170 | |||
162 | # The name of an image file (within the static path) to place at the top of |
|
171 | # The name of an image file (within the static path) to place at the top of | |
163 | # the sidebar. |
|
172 | # the sidebar. | |
164 | #html_logo = None |
|
173 | #html_logo = None | |
165 |
|
174 | |||
166 | # Add any paths that contain custom static files (such as style sheets) here, |
|
175 | # Add any paths that contain custom static files (such as style sheets) here, | |
167 | # relative to this directory. They are copied after the builtin static files, |
|
176 | # relative to this directory. They are copied after the builtin static files, | |
168 | # so a file named "default.css" will overwrite the builtin "default.css". |
|
177 | # so a file named "default.css" will overwrite the builtin "default.css". | |
169 | html_static_path = ['_static'] |
|
178 | html_static_path = ['_static'] | |
170 |
|
179 | |||
171 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
|
180 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, | |
172 | # using the given strftime format. |
|
181 | # using the given strftime format. | |
173 | html_last_updated_fmt = '%b %d, %Y' |
|
182 | html_last_updated_fmt = '%b %d, %Y' | |
174 |
|
183 | |||
175 | # If true, SmartyPants will be used to convert quotes and dashes to |
|
184 | # If true, SmartyPants will be used to convert quotes and dashes to | |
176 | # typographically correct entities. |
|
185 | # typographically correct entities. | |
177 | #html_use_smartypants = True |
|
186 | #html_use_smartypants = True | |
178 |
|
187 | |||
179 | # Custom sidebar templates, maps document names to template names. |
|
188 | # Custom sidebar templates, maps document names to template names. | |
180 | #html_sidebars = {} |
|
189 | #html_sidebars = {} | |
181 |
|
190 | |||
182 | # Additional templates that should be rendered to pages, maps page names to |
|
191 | # Additional templates that should be rendered to pages, maps page names to | |
183 | # template names. |
|
192 | # template names. | |
184 | html_additional_pages = { |
|
193 | html_additional_pages = { | |
185 | 'interactive/htmlnotebook': 'notebook_redirect.html', |
|
194 | 'interactive/htmlnotebook': 'notebook_redirect.html', | |
186 | 'interactive/notebook': 'notebook_redirect.html', |
|
195 | 'interactive/notebook': 'notebook_redirect.html', | |
187 | 'interactive/nbconvert': 'notebook_redirect.html', |
|
196 | 'interactive/nbconvert': 'notebook_redirect.html', | |
188 | 'interactive/public_server': 'notebook_redirect.html', |
|
197 | 'interactive/public_server': 'notebook_redirect.html', | |
189 | } |
|
198 | } | |
190 |
|
199 | |||
191 | # If false, no module index is generated. |
|
200 | # If false, no module index is generated. | |
192 | #html_use_modindex = True |
|
201 | #html_use_modindex = True | |
193 |
|
202 | |||
194 | # If true, the reST sources are included in the HTML build as _sources/<name>. |
|
203 | # If true, the reST sources are included in the HTML build as _sources/<name>. | |
195 | #html_copy_source = True |
|
204 | #html_copy_source = True | |
196 |
|
205 | |||
197 | # If true, an OpenSearch description file will be output, and all pages will |
|
206 | # If true, an OpenSearch description file will be output, and all pages will | |
198 | # contain a <link> tag referring to it. The value of this option must be the |
|
207 | # contain a <link> tag referring to it. The value of this option must be the | |
199 | # base URL from which the finished HTML is served. |
|
208 | # base URL from which the finished HTML is served. | |
200 | #html_use_opensearch = '' |
|
209 | #html_use_opensearch = '' | |
201 |
|
210 | |||
202 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). |
|
211 | # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). | |
203 | #html_file_suffix = '' |
|
212 | #html_file_suffix = '' | |
204 |
|
213 | |||
205 | # Output file base name for HTML help builder. |
|
214 | # Output file base name for HTML help builder. | |
206 | htmlhelp_basename = 'ipythondoc' |
|
215 | htmlhelp_basename = 'ipythondoc' | |
207 |
|
216 | |||
208 | intersphinx_mapping = {'python': ('http://docs.python.org/3/', None), |
|
217 | intersphinx_mapping = {'python': ('http://docs.python.org/3/', None), | |
209 | 'rpy2': ('http://rpy.sourceforge.net/rpy2/doc-2.4/html/', None), |
|
218 | 'rpy2': ('http://rpy.sourceforge.net/rpy2/doc-2.4/html/', None), | |
210 | 'traitlets': ('http://traitlets.readthedocs.io/en/latest/', None), |
|
219 | 'traitlets': ('http://traitlets.readthedocs.io/en/latest/', None), | |
211 | 'jupyterclient': ('http://jupyter-client.readthedocs.io/en/latest/', None), |
|
220 | 'jupyterclient': ('http://jupyter-client.readthedocs.io/en/latest/', None), | |
212 | 'ipyparallel': ('http://ipyparallel.readthedocs.io/en/latest/', None), |
|
221 | 'ipyparallel': ('http://ipyparallel.readthedocs.io/en/latest/', None), | |
213 | 'jupyter': ('http://jupyter.readthedocs.io/en/latest/', None), |
|
222 | 'jupyter': ('http://jupyter.readthedocs.io/en/latest/', None), | |
214 | } |
|
223 | } | |
215 |
|
224 | |||
216 | # Options for LaTeX output |
|
225 | # Options for LaTeX output | |
217 | # ------------------------ |
|
226 | # ------------------------ | |
218 |
|
227 | |||
219 | # The paper size ('letter' or 'a4'). |
|
228 | # The paper size ('letter' or 'a4'). | |
220 | latex_paper_size = 'letter' |
|
229 | latex_paper_size = 'letter' | |
221 |
|
230 | |||
222 | # The font size ('10pt', '11pt' or '12pt'). |
|
231 | # The font size ('10pt', '11pt' or '12pt'). | |
223 | latex_font_size = '11pt' |
|
232 | latex_font_size = '11pt' | |
224 |
|
233 | |||
225 | # Grouping the document tree into LaTeX files. List of tuples |
|
234 | # Grouping the document tree into LaTeX files. List of tuples | |
226 | # (source start file, target name, title, author, document class [howto/manual]). |
|
235 | # (source start file, target name, title, author, document class [howto/manual]). | |
227 |
|
236 | |||
228 | latex_documents = [ |
|
237 | latex_documents = [ | |
229 | ('index', 'ipython.tex', 'IPython Documentation', |
|
238 | ('index', 'ipython.tex', 'IPython Documentation', | |
230 | u"""The IPython Development Team""", 'manual', True), |
|
239 | u"""The IPython Development Team""", 'manual', True), | |
231 | ('parallel/winhpc_index', 'winhpc_whitepaper.tex', |
|
240 | ('parallel/winhpc_index', 'winhpc_whitepaper.tex', | |
232 | 'Using IPython on Windows HPC Server 2008', |
|
241 | 'Using IPython on Windows HPC Server 2008', | |
233 | u"Brian E. Granger", 'manual', True) |
|
242 | u"Brian E. Granger", 'manual', True) | |
234 | ] |
|
243 | ] | |
235 |
|
244 | |||
236 | # The name of an image file (relative to this directory) to place at the top of |
|
245 | # The name of an image file (relative to this directory) to place at the top of | |
237 | # the title page. |
|
246 | # the title page. | |
238 | #latex_logo = None |
|
247 | #latex_logo = None | |
239 |
|
248 | |||
240 | # For "manual" documents, if this is true, then toplevel headings are parts, |
|
249 | # For "manual" documents, if this is true, then toplevel headings are parts, | |
241 | # not chapters. |
|
250 | # not chapters. | |
242 | #latex_use_parts = False |
|
251 | #latex_use_parts = False | |
243 |
|
252 | |||
244 | # Additional stuff for the LaTeX preamble. |
|
253 | # Additional stuff for the LaTeX preamble. | |
245 | #latex_preamble = '' |
|
254 | #latex_preamble = '' | |
246 |
|
255 | |||
247 | # Documents to append as an appendix to all manuals. |
|
256 | # Documents to append as an appendix to all manuals. | |
248 | #latex_appendices = [] |
|
257 | #latex_appendices = [] | |
249 |
|
258 | |||
250 | # If false, no module index is generated. |
|
259 | # If false, no module index is generated. | |
251 | latex_use_modindex = True |
|
260 | latex_use_modindex = True | |
252 |
|
261 | |||
253 |
|
262 | |||
254 | # Options for texinfo output |
|
263 | # Options for texinfo output | |
255 | # -------------------------- |
|
264 | # -------------------------- | |
256 |
|
265 | |||
257 | texinfo_documents = [ |
|
266 | texinfo_documents = [ | |
258 | (master_doc, 'ipython', 'IPython Documentation', |
|
267 | (master_doc, 'ipython', 'IPython Documentation', | |
259 | 'The IPython Development Team', |
|
268 | 'The IPython Development Team', | |
260 | 'IPython', |
|
269 | 'IPython', | |
261 | 'IPython Documentation', |
|
270 | 'IPython Documentation', | |
262 | 'Programming', |
|
271 | 'Programming', | |
263 | 1), |
|
272 | 1), | |
264 | ] |
|
273 | ] | |
265 |
|
274 | |||
266 | modindex_common_prefix = ['IPython.'] |
|
275 | modindex_common_prefix = ['IPython.'] | |
267 |
|
276 | |||
268 |
|
277 | |||
269 | # Cleanup |
|
278 | # Cleanup | |
270 | # ------- |
|
279 | # ------- | |
271 | # delete release info to avoid pickling errors from sphinx |
|
280 | # delete release info to avoid pickling errors from sphinx | |
272 |
|
281 | |||
273 | del iprelease |
|
282 | del iprelease |
@@ -1,163 +1,164 b'' | |||||
1 | ============ |
|
1 | ============ | |
2 | 5.x Series |
|
2 | 5.x Series | |
3 | ============ |
|
3 | ============ | |
4 |
|
4 | |||
5 | IPython 5.0 |
|
5 | IPython 5.0 | |
6 | =========== |
|
6 | =========== | |
7 |
|
7 | |||
8 | Released June, 2016 |
|
8 | Released June, 2016 | |
9 |
|
9 | |||
10 | IPython 5.0 now uses `prompt-toolkit` for the command line interface, thus |
|
10 | IPython 5.0 now uses `prompt-toolkit` for the command line interface, thus | |
11 | allowing real multi-line editing and syntactic coloration as you type. |
|
11 | allowing real multi-line editing and syntactic coloration as you type. | |
12 |
|
12 | |||
13 |
|
13 | |||
14 | When using IPython as a subprocess, like for emacs inferior-shell, IPython can |
|
14 | When using IPython as a subprocess, like for emacs inferior-shell, IPython can | |
15 | be started with --simple-prompt flag, which will bypass the prompt_toolkit |
|
15 | be started with --simple-prompt flag, which will bypass the prompt_toolkit | |
16 | input layer. In this mode completion, prompt color and many other features are |
|
16 | input layer. In this mode completion, prompt color and many other features are | |
17 | disabled. |
|
17 | disabled. | |
18 |
|
18 | |||
19 | Backwards incompatible changes |
|
19 | Backwards incompatible changes | |
20 | ------------------------------ |
|
20 | ------------------------------ | |
21 |
|
21 | |||
22 |
|
22 | |||
23 | The `install_ext magic` function which was deprecated since 4.0 have now been deleted. |
|
23 | The `install_ext magic` function which was deprecated since 4.0 have now been deleted. | |
24 | You can still distribute and install extension as packages on PyPI. |
|
24 | You can still distribute and install extension as packages on PyPI. | |
25 |
|
25 | |||
26 | Update IPython event triggering to ensure callback registration and |
|
26 | Update IPython event triggering to ensure callback registration and | |
27 | unregistration only affects the set of callbacks the *next* time that event is |
|
27 | unregistration only affects the set of callbacks the *next* time that event is | |
28 | triggered. See :ghissue:`9447` and :ghpull:`9453`. |
|
28 | triggered. See :ghissue:`9447` and :ghpull:`9453`. | |
29 |
|
29 | |||
30 | This is a change to the existing semantics, wherein one callback registering a |
|
30 | This is a change to the existing semantics, wherein one callback registering a | |
31 | second callback when triggered for an event would previously be invoked for |
|
31 | second callback when triggered for an event would previously be invoked for | |
32 | that same event. |
|
32 | that same event. | |
33 |
|
33 | |||
34 | Integration with pydb has been removed since pydb development has been stopped |
|
34 | Integration with pydb has been removed since pydb development has been stopped | |
35 | since 2012, and pydb is not installable from PyPI |
|
35 | since 2012, and pydb is not installable from PyPI | |
36 |
|
36 | |||
37 |
|
37 | |||
38 |
|
38 | |||
39 | Replacement of readline in TerminalInteractiveShell and PDB |
|
39 | Replacement of readline in TerminalInteractiveShell and PDB | |
40 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
40 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
41 |
|
41 | |||
42 | IPython 5.0 now uses ``prompt_toolkit``. The |
|
42 | IPython 5.0 now uses ``prompt_toolkit``. The | |
43 | ``IPython.terminal.interactiveshell.TerminalInteractiveShell`` now uses |
|
43 | ``IPython.terminal.interactiveshell.TerminalInteractiveShell`` now uses | |
44 | ``prompt_toolkit``. It is an almost complete rewrite, so many settings have |
|
44 | ``prompt_toolkit``. It is an almost complete rewrite, so many settings have | |
45 | thus changed or disappeared. The class keep the same name to avoid breaking |
|
45 | thus changed or disappeared. The class keep the same name to avoid breaking | |
46 | user configuration for the options which names is unchanged. |
|
46 | user configuration for the options which names is unchanged. | |
47 |
|
47 | |||
48 | The usage of ``prompt_toolkit`` is accompanied by a complete removal of all |
|
48 | The usage of ``prompt_toolkit`` is accompanied by a complete removal of all | |
49 | code, using ``readline``. A particular effect of not using `readline` anymore |
|
49 | code, using ``readline``. A particular effect of not using `readline` anymore | |
50 | is that `.inputrc` settings are note effective anymore. Options having similar |
|
50 | is that `.inputrc` settings are note effective anymore. Options having similar | |
51 | effects have likely been replaced by a configuration option on IPython itself |
|
51 | effects have likely been replaced by a configuration option on IPython itself | |
52 | (e.g: vi input mode). |
|
52 | (e.g: vi input mode). | |
53 |
|
53 | |||
54 | The `PromptManager` class have been removed, and the prompt machinery simplified. |
|
54 | The `PromptManager` class have been removed, and the prompt machinery simplified. | |
55 | See `TerminalInteractiveShell.prompts` configurable for how to setup your prompts. |
|
55 | See `TerminalInteractiveShell.prompts` configurable for how to setup your prompts. | |
56 |
|
56 | |||
57 | .. note:: |
|
57 | .. note:: | |
58 |
|
58 | |||
59 | During developement and beta cycle, ``TerminalInteractiveShell`` was |
|
59 | During developement and beta cycle, ``TerminalInteractiveShell`` was | |
60 | temporarly moved to ``IPtyhon.terminal.ptshell``. |
|
60 | temporarly moved to ``IPtyhon.terminal.ptshell``. | |
61 |
|
61 | |||
62 |
|
62 | |||
63 | Most of the above remarks also affect `IPython.core.debugger.Pdb`, the `%debug` |
|
63 | Most of the above remarks also affect `IPython.core.debugger.Pdb`, the `%debug` | |
64 | and `%pdb` magic which do not use readline anymore either. |
|
64 | and `%pdb` magic which do not use readline anymore either. | |
65 |
|
65 | |||
66 | The color handling has been slightly changed and is now exposed |
|
66 | The color handling has been slightly changed and is now exposed | |
67 | through, in particular the colors of prompts and as you type |
|
67 | through, in particular the colors of prompts and as you type | |
68 | highlighting can be affected by : |
|
68 | highlighting can be affected by : | |
69 | ``TerminalInteractiveShell.highlight_style``. With default |
|
69 | ``TerminalInteractiveShell.highlight_style``. With default | |
70 | configuration the ``--colors`` flag and ``%colors`` magic behavior |
|
70 | configuration the ``--colors`` flag and ``%colors`` magic behavior | |
71 | should be mostly unchanged. See the `colors <termcolour>`_ section of |
|
71 | should be mostly unchanged. See the `colors <termcolour>`_ section of | |
72 | our documentation |
|
72 | our documentation | |
73 |
|
73 | |||
74 | Provisional Changes |
|
74 | Provisional Changes | |
75 | ------------------- |
|
75 | ------------------- | |
76 |
|
76 | |||
77 | Provisional changes are in experimental functionality that may, or may not make |
|
77 | Provisional changes are in experimental functionality that may, or may not make | |
78 | it to future version of IPython, and which API may change without warnings. |
|
78 | it to future version of IPython, and which API may change without warnings. | |
79 | Activating these feature and using these API is at your own risk, and may have |
|
79 | Activating these feature and using these API is at your own risk, and may have | |
80 | security implication for your system, especially if used with the Jupyter notebook, |
|
80 | security implication for your system, especially if used with the Jupyter notebook, | |
81 |
|
81 | |||
82 | When running via the Jupyter notebook interfaces, or other compatible client, |
|
82 | When running via the Jupyter notebook interfaces, or other compatible client, | |
83 | you can enable rich documentation experimental functionality: |
|
83 | you can enable rich documentation experimental functionality: | |
84 |
|
84 | |||
85 | When the ``docrepr`` package is installed setting the boolean flag |
|
85 | When the ``docrepr`` package is installed setting the boolean flag | |
86 | ``InteractiveShell.sphinxify_docstring`` to ``True``, will process the various |
|
86 | ``InteractiveShell.sphinxify_docstring`` to ``True``, will process the various | |
87 | object through sphinx before displaying them (see the ``docrepr`` package |
|
87 | object through sphinx before displaying them (see the ``docrepr`` package | |
88 | documentation for more information. |
|
88 | documentation for more information. | |
89 |
|
89 | |||
90 | You need to also enable the IPython pager display rich HTML representation |
|
90 | You need to also enable the IPython pager display rich HTML representation | |
91 | using the ``InteractiveShell.enable_html_pager`` boolean configuration option. |
|
91 | using the ``InteractiveShell.enable_html_pager`` boolean configuration option. | |
92 | As usual you can set these configuration options globally in your configuration |
|
92 | As usual you can set these configuration options globally in your configuration | |
93 | files, alternatively you can turn them on dynamically using the following |
|
93 | files, alternatively you can turn them on dynamically using the following | |
94 | snippet: |
|
94 | snippet: | |
95 |
|
95 | |||
96 | .. code-block:: python |
|
96 | .. code-block:: python | |
97 |
|
97 | |||
98 | ip = get_ipython() |
|
98 | ip = get_ipython() | |
99 | ip.sphinxify_docstring = True |
|
99 | ip.sphinxify_docstring = True | |
100 | ip.enable_html_pager = True |
|
100 | ip.enable_html_pager = True | |
101 |
|
101 | |||
|
102 | ||||
102 | You can test the effect of various combinations of the above configuration in |
|
103 | You can test the effect of various combinations of the above configuration in | |
103 | the Jupyter notebook, with things example like : |
|
104 | the Jupyter notebook, with things example like : | |
104 |
|
105 | |||
105 | .. code-block:: python |
|
106 | .. code-block:: ipython | |
106 |
|
107 | |||
107 | import numpy as np |
|
108 | import numpy as np | |
108 | np.histogram? |
|
109 | np.histogram? | |
109 |
|
|
110 | ||
|
111 | ||||
110 | This is part of an effort to make Documentation in Python richer and provide in |
|
112 | This is part of an effort to make Documentation in Python richer and provide in | |
111 | the long term if possible dynamic examples that can contain math, images, |
|
113 | the long term if possible dynamic examples that can contain math, images, | |
112 | widgets... As stated above this is nightly experimental feature with a lot of |
|
114 | widgets... As stated above this is nightly experimental feature with a lot of | |
113 | (fun) problem to solve. We would be happy to get your feedback and expertise on |
|
115 | (fun) problem to solve. We would be happy to get your feedback and expertise on | |
114 | it. |
|
116 | it. | |
115 |
|
117 | |||
116 |
|
118 | |||
117 | Removed Feature |
|
119 | Removed Feature | |
118 | --------------- |
|
120 | --------------- | |
119 |
|
121 | |||
120 |
|
|
122 | - ``TerminalInteractiveShell.autoedit_syntax`` Has been broken for many years now | |
121 | apparently. It has been removed. |
|
123 | apparently. It has been removed. | |
122 |
|
124 | |||
123 |
|
125 | |||
124 | Deprecated Features |
|
126 | Deprecated Features | |
125 | ------------------- |
|
127 | ------------------- | |
126 |
|
128 | |||
127 | Some deprecated feature, don't forget to enable `DeprecationWarning` as error |
|
129 | Some deprecated feature, don't forget to enable ``DeprecationWarning`` as error | |
128 | of you are using IPython in Continuous Integration setup or in your testing in general: |
|
130 | of you are using IPython in Continuous Integration setup or in your testing in general: | |
129 |
|
131 | |||
130 | .. code:: |
|
132 | .. code-block:: python | |
131 | :python: |
|
|||
132 |
|
|
133 | ||
133 | import warnings |
|
134 | import warnings | |
134 | warnings.filterwarnings('error', '.*', DeprecationWarning, module='yourmodule.*') |
|
135 | warnings.filterwarnings('error', '.*', DeprecationWarning, module='yourmodule.*') | |
135 |
|
136 | |||
136 |
|
137 | |||
137 |
|
|
138 | - ``hooks.fix_error_editor`` seem to be unused and is pending deprecation. | |
138 |
|
|
139 | - `IPython/core/excolors.py:ExceptionColors` is deprecated. | |
139 |
|
|
140 | - `IPython.core.InteractiveShell:write()` is deprecated, use `sys.stdout` instead. | |
140 |
|
|
141 | - `IPython.core.InteractiveShell:write_err()` is deprecated, use `sys.stderr` instead. | |
141 |
|
|
142 | - The `formatter` keyword argument to `Inspector.info` in `IPython.core.oinspec` has now no effects. | |
142 |
|
|
143 | - The `global_ns` keyword argument of IPython Embed was deprecated, and will now have no effect. Use `module` keyword argument instead. | |
143 |
|
144 | |||
144 |
|
145 | |||
145 | Known Issues: |
|
146 | Known Issues: | |
146 | ------------- |
|
147 | ------------- | |
147 |
|
148 | |||
148 |
|
|
149 | - ``<Esc>`` Key does not dismiss the completer and does not clear the current | |
149 |
|
|
150 | buffer. This is an on purpose modification due to current technical | |
150 |
|
|
151 | limitation. Cf :ghpull:`9572`. Escape the control character which is used | |
151 |
|
|
152 | for other shortcut, and there is no practical way to distinguish. Use Ctr-G | |
152 |
|
|
153 | or Ctrl-C as an alternative. | |
153 |
|
154 | |||
154 |
|
|
155 | - Cannot use ``Shift-Enter`` and ``Ctrl-Enter`` to submit code in terminal. cf | |
155 |
|
|
156 | :ghissue:`9587` and :ghissue:`9401`. In terminal there is no practical way to | |
156 |
|
|
157 | distinguish these key sequences from a normal new line return. | |
157 |
|
158 | |||
158 |
|
|
159 | - ``PageUp`` and ``pageDown`` do not move through completion menu. | |
159 |
|
160 | |||
160 |
|
|
161 | - Color styles might not adapt to terminal emulator themes. This will need new | |
161 |
|
|
162 | version of Pygments to be released, and can be mitigated with custom themes. | |
162 |
|
163 | |||
163 |
|
164 |
General Comments 0
You need to be logged in to leave comments.
Login now