##// END OF EJS Templates
Bit nitpicky about rst markup, find more errors.
Matthias Bussonnier -
Show More
@@ -1,151 +1,151 b''
1 # encoding: utf-8
1 # encoding: utf-8
2 """
2 """
3 IPython: tools for interactive and parallel computing in Python.
3 IPython: tools for interactive and parallel computing in Python.
4
4
5 https://ipython.org
5 https://ipython.org
6 """
6 """
7 #-----------------------------------------------------------------------------
7 #-----------------------------------------------------------------------------
8 # Copyright (c) 2008-2011, IPython Development Team.
8 # Copyright (c) 2008-2011, IPython Development Team.
9 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
9 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
10 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
11 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 #
12 #
13 # Distributed under the terms of the Modified BSD License.
13 # Distributed under the terms of the Modified BSD License.
14 #
14 #
15 # The full license is in the file COPYING.txt, distributed with this software.
15 # The full license is in the file COPYING.txt, distributed with this software.
16 #-----------------------------------------------------------------------------
16 #-----------------------------------------------------------------------------
17
17
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19 # Imports
19 # Imports
20 #-----------------------------------------------------------------------------
20 #-----------------------------------------------------------------------------
21
21
22 import os
22 import os
23 import sys
23 import sys
24
24
25 #-----------------------------------------------------------------------------
25 #-----------------------------------------------------------------------------
26 # Setup everything
26 # Setup everything
27 #-----------------------------------------------------------------------------
27 #-----------------------------------------------------------------------------
28
28
29 # Don't forget to also update setup.py when this changes!
29 # Don't forget to also update setup.py when this changes!
30 if sys.version_info < (3, 5):
30 if sys.version_info < (3, 5):
31 raise ImportError(
31 raise ImportError(
32 """
32 """
33 IPython 7.0+ supports Python 3.5 and above.
33 IPython 7.0+ supports Python 3.5 and above.
34 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
34 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
35 Python 3.3 and 3.4 were supported up to IPython 6.x.
35 Python 3.3 and 3.4 were supported up to IPython 6.x.
36
36
37 See IPython `README.rst` file for more information:
37 See IPython `README.rst` file for more information:
38
38
39 https://github.com/ipython/ipython/blob/master/README.rst
39 https://github.com/ipython/ipython/blob/master/README.rst
40
40
41 """)
41 """)
42
42
43 # Make it easy to import extensions - they are always directly on pythonpath.
43 # Make it easy to import extensions - they are always directly on pythonpath.
44 # Therefore, non-IPython modules can be added to extensions directory.
44 # Therefore, non-IPython modules can be added to extensions directory.
45 # This should probably be in ipapp.py.
45 # This should probably be in ipapp.py.
46 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
46 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
47
47
48 #-----------------------------------------------------------------------------
48 #-----------------------------------------------------------------------------
49 # Setup the top level names
49 # Setup the top level names
50 #-----------------------------------------------------------------------------
50 #-----------------------------------------------------------------------------
51
51
52 from .core.getipython import get_ipython
52 from .core.getipython import get_ipython
53 from .core import release
53 from .core import release
54 from .core.application import Application
54 from .core.application import Application
55 from .terminal.embed import embed
55 from .terminal.embed import embed
56
56
57 from .core.interactiveshell import InteractiveShell
57 from .core.interactiveshell import InteractiveShell
58 from .testing import test
58 from .testing import test
59 from .utils.sysinfo import sys_info
59 from .utils.sysinfo import sys_info
60 from .utils.frame import extract_module_locals
60 from .utils.frame import extract_module_locals
61
61
62 # Release data
62 # Release data
63 __author__ = '%s <%s>' % (release.author, release.author_email)
63 __author__ = '%s <%s>' % (release.author, release.author_email)
64 __license__ = release.license
64 __license__ = release.license
65 __version__ = release.version
65 __version__ = release.version
66 version_info = release.version_info
66 version_info = release.version_info
67
67
68 def embed_kernel(module=None, local_ns=None, **kwargs):
68 def embed_kernel(module=None, local_ns=None, **kwargs):
69 """Embed and start an IPython kernel in a given scope.
69 """Embed and start an IPython kernel in a given scope.
70
70
71 If you don't want the kernel to initialize the namespace
71 If you don't want the kernel to initialize the namespace
72 from the scope of the surrounding function,
72 from the scope of the surrounding function,
73 and/or you want to load full IPython configuration,
73 and/or you want to load full IPython configuration,
74 you probably want `IPython.start_kernel()` instead.
74 you probably want `IPython.start_kernel()` instead.
75
75
76 Parameters
76 Parameters
77 ----------
77 ----------
78 module : ModuleType, optional
78 module : types.ModuleType, optional
79 The module to load into IPython globals (default: caller)
79 The module to load into IPython globals (default: caller)
80 local_ns : dict, optional
80 local_ns : dict, optional
81 The namespace to load into IPython user namespace (default: caller)
81 The namespace to load into IPython user namespace (default: caller)
82
82
83 kwargs : various, optional
83 kwargs : various, optional
84 Further keyword args are relayed to the IPKernelApp constructor,
84 Further keyword args are relayed to the IPKernelApp constructor,
85 allowing configuration of the Kernel. Will only have an effect
85 allowing configuration of the Kernel. Will only have an effect
86 on the first embed_kernel call for a given process.
86 on the first embed_kernel call for a given process.
87 """
87 """
88
88
89 (caller_module, caller_locals) = extract_module_locals(1)
89 (caller_module, caller_locals) = extract_module_locals(1)
90 if module is None:
90 if module is None:
91 module = caller_module
91 module = caller_module
92 if local_ns is None:
92 if local_ns is None:
93 local_ns = caller_locals
93 local_ns = caller_locals
94
94
95 # Only import .zmq when we really need it
95 # Only import .zmq when we really need it
96 from ipykernel.embed import embed_kernel as real_embed_kernel
96 from ipykernel.embed import embed_kernel as real_embed_kernel
97 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
97 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
98
98
99 def start_ipython(argv=None, **kwargs):
99 def start_ipython(argv=None, **kwargs):
100 """Launch a normal IPython instance (as opposed to embedded)
100 """Launch a normal IPython instance (as opposed to embedded)
101
101
102 `IPython.embed()` puts a shell in a particular calling scope,
102 `IPython.embed()` puts a shell in a particular calling scope,
103 such as a function or method for debugging purposes,
103 such as a function or method for debugging purposes,
104 which is often not desirable.
104 which is often not desirable.
105
105
106 `start_ipython()` does full, regular IPython initialization,
106 `start_ipython()` does full, regular IPython initialization,
107 including loading startup files, configuration, etc.
107 including loading startup files, configuration, etc.
108 much of which is skipped by `embed()`.
108 much of which is skipped by `embed()`.
109
109
110 This is a public API method, and will survive implementation changes.
110 This is a public API method, and will survive implementation changes.
111
111
112 Parameters
112 Parameters
113 ----------
113 ----------
114
114
115 argv : list or None, optional
115 argv : list or None, optional
116 If unspecified or None, IPython will parse command-line options from sys.argv.
116 If unspecified or None, IPython will parse command-line options from sys.argv.
117 To prevent any command-line parsing, pass an empty list: `argv=[]`.
117 To prevent any command-line parsing, pass an empty list: `argv=[]`.
118 user_ns : dict, optional
118 user_ns : dict, optional
119 specify this dictionary to initialize the IPython user namespace with particular values.
119 specify this dictionary to initialize the IPython user namespace with particular values.
120 kwargs : various, optional
120 kwargs : various, optional
121 Any other kwargs will be passed to the Application constructor,
121 Any other kwargs will be passed to the Application constructor,
122 such as `config`.
122 such as `config`.
123 """
123 """
124 from IPython.terminal.ipapp import launch_new_instance
124 from IPython.terminal.ipapp import launch_new_instance
125 return launch_new_instance(argv=argv, **kwargs)
125 return launch_new_instance(argv=argv, **kwargs)
126
126
127 def start_kernel(argv=None, **kwargs):
127 def start_kernel(argv=None, **kwargs):
128 """Launch a normal IPython kernel instance (as opposed to embedded)
128 """Launch a normal IPython kernel instance (as opposed to embedded)
129
129
130 `IPython.embed_kernel()` puts a shell in a particular calling scope,
130 `IPython.embed_kernel()` puts a shell in a particular calling scope,
131 such as a function or method for debugging purposes,
131 such as a function or method for debugging purposes,
132 which is often not desirable.
132 which is often not desirable.
133
133
134 `start_kernel()` does full, regular IPython initialization,
134 `start_kernel()` does full, regular IPython initialization,
135 including loading startup files, configuration, etc.
135 including loading startup files, configuration, etc.
136 much of which is skipped by `embed()`.
136 much of which is skipped by `embed()`.
137
137
138 Parameters
138 Parameters
139 ----------
139 ----------
140
140
141 argv : list or None, optional
141 argv : list or None, optional
142 If unspecified or None, IPython will parse command-line options from sys.argv.
142 If unspecified or None, IPython will parse command-line options from sys.argv.
143 To prevent any command-line parsing, pass an empty list: `argv=[]`.
143 To prevent any command-line parsing, pass an empty list: `argv=[]`.
144 user_ns : dict, optional
144 user_ns : dict, optional
145 specify this dictionary to initialize the IPython user namespace with particular values.
145 specify this dictionary to initialize the IPython user namespace with particular values.
146 kwargs : various, optional
146 kwargs : various, optional
147 Any other kwargs will be passed to the Application constructor,
147 Any other kwargs will be passed to the Application constructor,
148 such as `config`.
148 such as `config`.
149 """
149 """
150 from IPython.kernel.zmq.kernelapp import launch_new_instance
150 from IPython.kernel.zmq.kernelapp import launch_new_instance
151 return launch_new_instance(argv=argv, **kwargs)
151 return launch_new_instance(argv=argv, **kwargs)
@@ -1,296 +1,298 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 # http://read-the-docs.readthedocs.io/en/latest/faq.html
20 # http://read-the-docs.readthedocs.io/en/latest/faq.html
21 ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
21 ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
22
22
23 if ON_RTD:
23 if ON_RTD:
24 tags.add('rtd')
24 tags.add('rtd')
25
25
26 # RTD doesn't use the Makefile, so re-run autogen_{things}.py here.
26 # RTD doesn't use the Makefile, so re-run autogen_{things}.py here.
27 for name in ('config', 'api', 'magics', 'shortcuts'):
27 for name in ('config', 'api', 'magics', 'shortcuts'):
28 fname = 'autogen_{}.py'.format(name)
28 fname = 'autogen_{}.py'.format(name)
29 fpath = os.path.abspath(os.path.join('..', fname))
29 fpath = os.path.abspath(os.path.join('..', fname))
30 with open(fpath) as f:
30 with open(fpath) as f:
31 exec(compile(f.read(), fname, 'exec'), {
31 exec(compile(f.read(), fname, 'exec'), {
32 '__file__': fpath,
32 '__file__': fpath,
33 '__name__': '__main__',
33 '__name__': '__main__',
34 })
34 })
35 else:
35 else:
36 import sphinx_rtd_theme
36 import sphinx_rtd_theme
37 html_theme = "sphinx_rtd_theme"
37 html_theme = "sphinx_rtd_theme"
38 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
38 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
39
39
40 # If your extensions are in another directory, add it here. If the directory
40 # If your extensions are in another directory, add it here. If the directory
41 # is relative to the documentation root, use os.path.abspath to make it
41 # is relative to the documentation root, use os.path.abspath to make it
42 # absolute, like shown here.
42 # absolute, like shown here.
43 sys.path.insert(0, os.path.abspath('../sphinxext'))
43 sys.path.insert(0, os.path.abspath('../sphinxext'))
44
44
45 # We load the ipython release info into a dict by explicit execution
45 # We load the ipython release info into a dict by explicit execution
46 iprelease = {}
46 iprelease = {}
47 exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease)
47 exec(compile(open('../../IPython/core/release.py').read(), '../../IPython/core/release.py', 'exec'),iprelease)
48
48
49 # General configuration
49 # General configuration
50 # ---------------------
50 # ---------------------
51
51
52 # Add any Sphinx extension module names here, as strings. They can be extensions
52 # Add any Sphinx extension module names here, as strings. They can be extensions
53 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
53 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
54 extensions = [
54 extensions = [
55 'sphinx.ext.autodoc',
55 'sphinx.ext.autodoc',
56 'sphinx.ext.autosummary',
56 'sphinx.ext.autosummary',
57 'sphinx.ext.doctest',
57 'sphinx.ext.doctest',
58 'sphinx.ext.inheritance_diagram',
58 'sphinx.ext.inheritance_diagram',
59 'sphinx.ext.intersphinx',
59 'sphinx.ext.intersphinx',
60 'sphinx.ext.graphviz',
60 'sphinx.ext.graphviz',
61 'IPython.sphinxext.ipython_console_highlighting',
61 'IPython.sphinxext.ipython_console_highlighting',
62 'IPython.sphinxext.ipython_directive',
62 'IPython.sphinxext.ipython_directive',
63 'sphinx.ext.napoleon', # to preprocess docstrings
63 'sphinx.ext.napoleon', # to preprocess docstrings
64 'github', # for easy GitHub links
64 'github', # for easy GitHub links
65 'magics',
65 'magics',
66 'configtraits',
66 'configtraits',
67 ]
67 ]
68
68
69 nitpicky = True
70
69 # Add any paths that contain templates here, relative to this directory.
71 # Add any paths that contain templates here, relative to this directory.
70 templates_path = ['_templates']
72 templates_path = ['_templates']
71
73
72 # The suffix of source filenames.
74 # The suffix of source filenames.
73 source_suffix = '.rst'
75 source_suffix = '.rst'
74
76
75 rst_prolog = ''
77 rst_prolog = ''
76
78
77 def is_stable(extra):
79 def is_stable(extra):
78 for ext in {'dev', 'b', 'rc'}:
80 for ext in {'dev', 'b', 'rc'}:
79 if ext in extra:
81 if ext in extra:
80 return False
82 return False
81 return True
83 return True
82
84
83 if is_stable(iprelease['_version_extra']):
85 if is_stable(iprelease['_version_extra']):
84 tags.add('ipystable')
86 tags.add('ipystable')
85 print('Adding Tag: ipystable')
87 print('Adding Tag: ipystable')
86 else:
88 else:
87 tags.add('ipydev')
89 tags.add('ipydev')
88 print('Adding Tag: ipydev')
90 print('Adding Tag: ipydev')
89 rst_prolog += """
91 rst_prolog += """
90 .. warning::
92 .. warning::
91
93
92 This documentation covers a development version of IPython. The development
94 This documentation covers a development version of IPython. The development
93 version may differ significantly from the latest stable release.
95 version may differ significantly from the latest stable release.
94 """
96 """
95
97
96 rst_prolog += """
98 rst_prolog += """
97 .. important::
99 .. important::
98
100
99 This documentation covers IPython versions 6.0 and higher. Beginning with
101 This documentation covers IPython versions 6.0 and higher. Beginning with
100 version 6.0, IPython stopped supporting compatibility with Python versions
102 version 6.0, IPython stopped supporting compatibility with Python versions
101 lower than 3.3 including all versions of Python 2.7.
103 lower than 3.3 including all versions of Python 2.7.
102
104
103 If you are looking for an IPython version compatible with Python 2.7,
105 If you are looking for an IPython version compatible with Python 2.7,
104 please use the IPython 5.x LTS release and refer to its documentation (LTS
106 please use the IPython 5.x LTS release and refer to its documentation (LTS
105 is the long term support release).
107 is the long term support release).
106
108
107 """
109 """
108
110
109 # The master toctree document.
111 # The master toctree document.
110 master_doc = 'index'
112 master_doc = 'index'
111
113
112 # General substitutions.
114 # General substitutions.
113 project = 'IPython'
115 project = 'IPython'
114 copyright = 'The IPython Development Team'
116 copyright = 'The IPython Development Team'
115
117
116 # ghissue config
118 # ghissue config
117 github_project_url = "https://github.com/ipython/ipython"
119 github_project_url = "https://github.com/ipython/ipython"
118
120
119 # numpydoc config
121 # numpydoc config
120 numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings
122 numpydoc_show_class_members = False # Otherwise Sphinx emits thousands of warnings
121 numpydoc_class_members_toctree = False
123 numpydoc_class_members_toctree = False
122 warning_is_error = True
124 warning_is_error = True
123
125
124 # The default replacements for |version| and |release|, also used in various
126 # The default replacements for |version| and |release|, also used in various
125 # other places throughout the built documents.
127 # other places throughout the built documents.
126 #
128 #
127 # The full version, including alpha/beta/rc tags.
129 # The full version, including alpha/beta/rc tags.
128 release = "%s" % iprelease['version']
130 release = "%s" % iprelease['version']
129 # Just the X.Y.Z part, no '-dev'
131 # Just the X.Y.Z part, no '-dev'
130 version = iprelease['version'].split('-', 1)[0]
132 version = iprelease['version'].split('-', 1)[0]
131
133
132
134
133 # There are two options for replacing |today|: either, you set today to some
135 # There are two options for replacing |today|: either, you set today to some
134 # non-false value, then it is used:
136 # non-false value, then it is used:
135 #today = ''
137 #today = ''
136 # Else, today_fmt is used as the format for a strftime call.
138 # Else, today_fmt is used as the format for a strftime call.
137 today_fmt = '%B %d, %Y'
139 today_fmt = '%B %d, %Y'
138
140
139 # List of documents that shouldn't be included in the build.
141 # List of documents that shouldn't be included in the build.
140 #unused_docs = []
142 #unused_docs = []
141
143
142 # Exclude these glob-style patterns when looking for source files. They are
144 # Exclude these glob-style patterns when looking for source files. They are
143 # relative to the source/ directory.
145 # relative to the source/ directory.
144 exclude_patterns = []
146 exclude_patterns = []
145
147
146
148
147 # If true, '()' will be appended to :func: etc. cross-reference text.
149 # If true, '()' will be appended to :func: etc. cross-reference text.
148 #add_function_parentheses = True
150 #add_function_parentheses = True
149
151
150 # If true, the current module name will be prepended to all description
152 # If true, the current module name will be prepended to all description
151 # unit titles (such as .. function::).
153 # unit titles (such as .. function::).
152 #add_module_names = True
154 #add_module_names = True
153
155
154 # If true, sectionauthor and moduleauthor directives will be shown in the
156 # If true, sectionauthor and moduleauthor directives will be shown in the
155 # output. They are ignored by default.
157 # output. They are ignored by default.
156 #show_authors = False
158 #show_authors = False
157
159
158 # The name of the Pygments (syntax highlighting) style to use.
160 # The name of the Pygments (syntax highlighting) style to use.
159 pygments_style = 'sphinx'
161 pygments_style = 'sphinx'
160
162
161 # Set the default role so we can use `foo` instead of ``foo``
163 # Set the default role so we can use `foo` instead of ``foo``
162 default_role = 'literal'
164 default_role = 'literal'
163
165
164 # Options for HTML output
166 # Options for HTML output
165 # -----------------------
167 # -----------------------
166
168
167 # The style sheet to use for HTML and HTML Help pages. A file of that name
169 # The style sheet to use for HTML and HTML Help pages. A file of that name
168 # must exist either in Sphinx' static/ path, or in one of the custom paths
170 # must exist either in Sphinx' static/ path, or in one of the custom paths
169 # given in html_static_path.
171 # given in html_static_path.
170 # html_style = 'default.css'
172 # html_style = 'default.css'
171
173
172
174
173 # The name for this set of Sphinx documents. If None, it defaults to
175 # The name for this set of Sphinx documents. If None, it defaults to
174 # "<project> v<release> documentation".
176 # "<project> v<release> documentation".
175 #html_title = None
177 #html_title = None
176
178
177 # The name of an image file (within the static path) to place at the top of
179 # The name of an image file (within the static path) to place at the top of
178 # the sidebar.
180 # the sidebar.
179 #html_logo = None
181 #html_logo = None
180
182
181 # Add any paths that contain custom static files (such as style sheets) here,
183 # Add any paths that contain custom static files (such as style sheets) here,
182 # relative to this directory. They are copied after the builtin static files,
184 # relative to this directory. They are copied after the builtin static files,
183 # so a file named "default.css" will overwrite the builtin "default.css".
185 # so a file named "default.css" will overwrite the builtin "default.css".
184 html_static_path = ['_static']
186 html_static_path = ['_static']
185
187
186 # Favicon needs the directory name
188 # Favicon needs the directory name
187 html_favicon = '_static/favicon.ico'
189 html_favicon = '_static/favicon.ico'
188 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
190 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
189 # using the given strftime format.
191 # using the given strftime format.
190 html_last_updated_fmt = '%b %d, %Y'
192 html_last_updated_fmt = '%b %d, %Y'
191
193
192 # If true, SmartyPants will be used to convert quotes and dashes to
194 # If true, SmartyPants will be used to convert quotes and dashes to
193 # typographically correct entities.
195 # typographically correct entities.
194 #html_use_smartypants = True
196 #html_use_smartypants = True
195
197
196 # Custom sidebar templates, maps document names to template names.
198 # Custom sidebar templates, maps document names to template names.
197 #html_sidebars = {}
199 #html_sidebars = {}
198
200
199 # Additional templates that should be rendered to pages, maps page names to
201 # Additional templates that should be rendered to pages, maps page names to
200 # template names.
202 # template names.
201 html_additional_pages = {
203 html_additional_pages = {
202 'interactive/htmlnotebook': 'notebook_redirect.html',
204 'interactive/htmlnotebook': 'notebook_redirect.html',
203 'interactive/notebook': 'notebook_redirect.html',
205 'interactive/notebook': 'notebook_redirect.html',
204 'interactive/nbconvert': 'notebook_redirect.html',
206 'interactive/nbconvert': 'notebook_redirect.html',
205 'interactive/public_server': 'notebook_redirect.html',
207 'interactive/public_server': 'notebook_redirect.html',
206 }
208 }
207
209
208 # If false, no module index is generated.
210 # If false, no module index is generated.
209 #html_use_modindex = True
211 #html_use_modindex = True
210
212
211 # If true, the reST sources are included in the HTML build as _sources/<name>.
213 # If true, the reST sources are included in the HTML build as _sources/<name>.
212 #html_copy_source = True
214 #html_copy_source = True
213
215
214 # If true, an OpenSearch description file will be output, and all pages will
216 # If true, an OpenSearch description file will be output, and all pages will
215 # contain a <link> tag referring to it. The value of this option must be the
217 # contain a <link> tag referring to it. The value of this option must be the
216 # base URL from which the finished HTML is served.
218 # base URL from which the finished HTML is served.
217 #html_use_opensearch = ''
219 #html_use_opensearch = ''
218
220
219 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
221 # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
220 #html_file_suffix = ''
222 #html_file_suffix = ''
221
223
222 # Output file base name for HTML help builder.
224 # Output file base name for HTML help builder.
223 htmlhelp_basename = 'ipythondoc'
225 htmlhelp_basename = 'ipythondoc'
224
226
225 intersphinx_mapping = {'python': ('https://docs.python.org/3/', None),
227 intersphinx_mapping = {'python': ('https://docs.python.org/3/', None),
226 'rpy2': ('https://rpy2.readthedocs.io/en/version_2.8.x/', None),
228 'rpy2': ('https://rpy2.readthedocs.io/en/version_2.8.x/', None),
227 'traitlets': ('https://traitlets.readthedocs.io/en/latest/', None),
229 'traitlets': ('https://traitlets.readthedocs.io/en/latest/', None),
228 'jupyterclient': ('https://jupyter-client.readthedocs.io/en/latest/', None),
230 'jupyterclient': ('https://jupyter-client.readthedocs.io/en/latest/', None),
229 'ipyparallel': ('https://ipyparallel.readthedocs.io/en/latest/', None),
231 'ipyparallel': ('https://ipyparallel.readthedocs.io/en/latest/', None),
230 'jupyter': ('https://jupyter.readthedocs.io/en/latest/', None),
232 'jupyter': ('https://jupyter.readthedocs.io/en/latest/', None),
231 'jedi': ('https://jedi.readthedocs.io/en/latest/', None),
233 'jedi': ('https://jedi.readthedocs.io/en/latest/', None),
232 'traitlets': ('https://traitlets.readthedocs.io/en/latest/', None),
234 'traitlets': ('https://traitlets.readthedocs.io/en/latest/', None),
233 'ipykernel': ('https://ipykernel.readthedocs.io/en/latest/', None),
235 'ipykernel': ('https://ipykernel.readthedocs.io/en/latest/', None),
234 'prompt_toolkit' : ('https://python-prompt-toolkit.readthedocs.io/en/stable/', None),
236 'prompt_toolkit' : ('https://python-prompt-toolkit.readthedocs.io/en/stable/', None),
235 'ipywidgets': ('https://ipywidgets.readthedocs.io/en/stable/', None),
237 'ipywidgets': ('https://ipywidgets.readthedocs.io/en/stable/', None),
236 'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None)
238 'ipyparallel': ('https://ipyparallel.readthedocs.io/en/stable/', None)
237 }
239 }
238
240
239 # Options for LaTeX output
241 # Options for LaTeX output
240 # ------------------------
242 # ------------------------
241
243
242 # The paper size ('letter' or 'a4').
244 # The paper size ('letter' or 'a4').
243 latex_paper_size = 'letter'
245 latex_paper_size = 'letter'
244
246
245 # The font size ('10pt', '11pt' or '12pt').
247 # The font size ('10pt', '11pt' or '12pt').
246 latex_font_size = '11pt'
248 latex_font_size = '11pt'
247
249
248 # Grouping the document tree into LaTeX files. List of tuples
250 # Grouping the document tree into LaTeX files. List of tuples
249 # (source start file, target name, title, author, document class [howto/manual]).
251 # (source start file, target name, title, author, document class [howto/manual]).
250
252
251 latex_documents = [
253 latex_documents = [
252 ('index', 'ipython.tex', 'IPython Documentation',
254 ('index', 'ipython.tex', 'IPython Documentation',
253 u"""The IPython Development Team""", 'manual', True),
255 u"""The IPython Development Team""", 'manual', True),
254 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
256 ('parallel/winhpc_index', 'winhpc_whitepaper.tex',
255 'Using IPython on Windows HPC Server 2008',
257 'Using IPython on Windows HPC Server 2008',
256 u"Brian E. Granger", 'manual', True)
258 u"Brian E. Granger", 'manual', True)
257 ]
259 ]
258
260
259 # The name of an image file (relative to this directory) to place at the top of
261 # The name of an image file (relative to this directory) to place at the top of
260 # the title page.
262 # the title page.
261 #latex_logo = None
263 #latex_logo = None
262
264
263 # For "manual" documents, if this is true, then toplevel headings are parts,
265 # For "manual" documents, if this is true, then toplevel headings are parts,
264 # not chapters.
266 # not chapters.
265 #latex_use_parts = False
267 #latex_use_parts = False
266
268
267 # Additional stuff for the LaTeX preamble.
269 # Additional stuff for the LaTeX preamble.
268 #latex_preamble = ''
270 #latex_preamble = ''
269
271
270 # Documents to append as an appendix to all manuals.
272 # Documents to append as an appendix to all manuals.
271 #latex_appendices = []
273 #latex_appendices = []
272
274
273 # If false, no module index is generated.
275 # If false, no module index is generated.
274 latex_use_modindex = True
276 latex_use_modindex = True
275
277
276
278
277 # Options for texinfo output
279 # Options for texinfo output
278 # --------------------------
280 # --------------------------
279
281
280 texinfo_documents = [
282 texinfo_documents = [
281 (master_doc, 'ipython', 'IPython Documentation',
283 (master_doc, 'ipython', 'IPython Documentation',
282 'The IPython Development Team',
284 'The IPython Development Team',
283 'IPython',
285 'IPython',
284 'IPython Documentation',
286 'IPython Documentation',
285 'Programming',
287 'Programming',
286 1),
288 1),
287 ]
289 ]
288
290
289 modindex_common_prefix = ['IPython.']
291 modindex_common_prefix = ['IPython.']
290
292
291
293
292 # Cleanup
294 # Cleanup
293 # -------
295 # -------
294 # delete release info to avoid pickling errors from sphinx
296 # delete release info to avoid pickling errors from sphinx
295
297
296 del iprelease
298 del iprelease
@@ -1,230 +1,230 b''
1 ============
1 ============
2 7.x Series
2 7.x Series
3 ============
3 ============
4
4
5 .. _whatsnew700:
5 .. _whatsnew700:
6
6
7 IPython 7.0.0
7 IPython 7.0.0
8 =============
8 =============
9
9
10 Released Thursday September 27th, 2018
10 Released Thursday September 27th, 2018
11
11
12 IPython 7 include major features improvement as you can read in the following
12 IPython 7 include major features improvement as you can read in the following
13 changelog. This is also the second major version of IPython to support only
13 changelog. This is also the second major version of IPython to support only
14 Python 3 – starting at Python 3.4. Python 2 is still community supported
14 Python 3 – starting at Python 3.4. Python 2 is still community supported
15 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
15 on the bugfix only 5.x branch, but we remind you that Python 2 "end of life"
16 is on Jan 1st 2020.
16 is on Jan 1st 2020.
17
17
18 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
18 We were able to backport bug fixes to the 5.x branch thanks to our backport bot which
19 backported more than `70 Pull-Requests
19 backported more than `70 Pull-Requests
20 <https://github.com/ipython/ipython/pulls?page=3&q=is%3Apr+sort%3Aupdated-desc+author%3Aapp%2Fmeeseeksdev++5.x&utf8=%E2%9C%93>`_, but there are still many PRs that required manually work, and this is an area of the project were you can easily contribute by looking for `PRs still needed backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
20 <https://github.com/ipython/ipython/pulls?page=3&q=is%3Apr+sort%3Aupdated-desc+author%3Aapp%2Fmeeseeksdev++5.x&utf8=%E2%9C%93>`_, but there are still many PRs that required manually work, and this is an area of the project were you can easily contribute by looking for `PRs still needed backport <https://github.com/ipython/ipython/issues?q=label%3A%22Still+Needs+Manual+Backport%22+is%3Aclosed+sort%3Aupdated-desc>`_
21
21
22 IPython 6.x branch will likely not see any further release unless critical
22 IPython 6.x branch will likely not see any further release unless critical
23 bugs are found.
23 bugs are found.
24
24
25 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply running
25 Make sure you have pip > 9.0 before upgrading. You should be able to update by simply running
26
26
27 .. code::
27 .. code::
28
28
29 pip install ipython --upgrade
29 pip install ipython --upgrade
30
30
31 .. only:: ipydev
31 .. only:: ipydev
32
32
33 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
33 If you are trying to install or update an ``alpha``, ``beta``, or ``rc``
34 version, use pip ``--pre`` flag.
34 version, use pip ``--pre`` flag.
35
35
36 .. code::
36 .. code::
37
37
38 pip install ipython --upgrade --pre
38 pip install ipython --upgrade --pre
39
39
40
40
41 Or if you have conda installed:
41 Or if you have conda installed:
42
42
43 .. code::
43 .. code::
44
44
45 conda install ipython
45 conda install ipython
46
46
47
47
48
48
49 Prompt Toolkit 2.0
49 Prompt Toolkit 2.0
50 ------------------
50 ------------------
51
51
52 IPython 7.0+ now uses ``prompt_toolkit 2.0``, if you still need to use earlier
52 IPython 7.0+ now uses ``prompt_toolkit 2.0``, if you still need to use earlier
53 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
53 ``prompt_toolkit`` version you may need to pin IPython to ``<7.0``.
54
54
55 Autowait: Asynchronous REPL
55 Autowait: Asynchronous REPL
56 ---------------------------
56 ---------------------------
57
57
58 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
58 Staring with IPython 7.0 and on Python 3.6+, IPython can automatically await
59 code at top level, you should not need to access an event loop or runner
59 code at top level, you should not need to access an event loop or runner
60 yourself. To know more read the :ref:`autoawait` section of our docs, see
60 yourself. To know more read the :ref:`autoawait` section of our docs, see
61 :ghpull:`11265` or try the following code::
61 :ghpull:`11265` or try the following code::
62
62
63 Python 3.6.0
63 Python 3.6.0
64 Type 'copyright', 'credits' or 'license' for more information
64 Type 'copyright', 'credits' or 'license' for more information
65 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
65 IPython 7.0.0 -- An enhanced Interactive Python. Type '?' for help.
66
66
67 In [1]: import aiohttp
67 In [1]: import aiohttp
68 ...: result = aiohttp.get('https://api.github.com')
68 ...: result = aiohttp.get('https://api.github.com')
69
69
70 In [2]: response = await result
70 In [2]: response = await result
71 <pause for a few 100s ms>
71 <pause for a few 100s ms>
72
72
73 In [3]: await response.json()
73 In [3]: await response.json()
74 Out[3]:
74 Out[3]:
75 {'authorizations_url': 'https://api.github.com/authorizations',
75 {'authorizations_url': 'https://api.github.com/authorizations',
76 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
76 'code_search_url': 'https://api.github.com/search/code?q={query}{&page,per_page,sort,order}',
77 ...
77 ...
78 }
78 }
79
79
80 .. note::
80 .. note::
81
81
82 Async integration is experimental code, behavior may change or be removed
82 Async integration is experimental code, behavior may change or be removed
83 between Python and IPython versions without warnings.
83 between Python and IPython versions without warnings.
84
84
85 Integration is by default with `asyncio`, but other libraries can be configured,
85 Integration is by default with `asyncio`, but other libraries can be configured,
86 like ``curio`` or ``trio``, to improve concurrency in the REPL::
86 like ``curio`` or ``trio``, to improve concurrency in the REPL::
87
87
88 In [1]: %autoawait trio
88 In [1]: %autoawait trio
89
89
90 In [2]: import trio
90 In [2]: import trio
91
91
92 In [3]: async def child(i):
92 In [3]: async def child(i):
93 ...: print(" child %s goes to sleep"%i)
93 ...: print(" child %s goes to sleep"%i)
94 ...: await trio.sleep(2)
94 ...: await trio.sleep(2)
95 ...: print(" child %s wakes up"%i)
95 ...: print(" child %s wakes up"%i)
96
96
97 In [4]: print('parent start')
97 In [4]: print('parent start')
98 ...: async with trio.open_nursery() as n:
98 ...: async with trio.open_nursery() as n:
99 ...: for i in range(3):
99 ...: for i in range(3):
100 ...: n.spawn(child, i)
100 ...: n.spawn(child, i)
101 ...: print('parent end')
101 ...: print('parent end')
102 parent start
102 parent start
103 child 2 goes to sleep
103 child 2 goes to sleep
104 child 0 goes to sleep
104 child 0 goes to sleep
105 child 1 goes to sleep
105 child 1 goes to sleep
106 <about 2 seconds pause>
106 <about 2 seconds pause>
107 child 2 wakes up
107 child 2 wakes up
108 child 1 wakes up
108 child 1 wakes up
109 child 0 wakes up
109 child 0 wakes up
110 parent end
110 parent end
111
111
112 See :ref:`autoawait` for more information.
112 See :ref:`autoawait` for more information.
113
113
114
114
115 Asynchronous code in a Notebook interface or any other frontend using the
115 Asynchronous code in a Notebook interface or any other frontend using the
116 Jupyter Protocol will need further updates of the IPykernel package.
116 Jupyter Protocol will need further updates of the IPykernel package.
117
117
118 Non-Asynchronous code
118 Non-Asynchronous code
119 ~~~~~~~~~~~~~~~~~~~~~
119 ~~~~~~~~~~~~~~~~~~~~~
120
120
121 As the internal API of IPython is now asynchronous, IPython needs to run under
121 As the internal API of IPython is now asynchronous, IPython needs to run under
122 an event loop. In order to allow many workflows, (like using the :magic:`%run`
122 an event loop. In order to allow many workflows, (like using the :magic:`%run`
123 magic, or copy_pasting code that explicitly starts/stop event loop), when
123 magic, or copy_pasting code that explicitly starts/stop event loop), when
124 top-level code is detected as not being asynchronous, IPython code is advanced
124 top-level code is detected as not being asynchronous, IPython code is advanced
125 via a pseudo-synchronous runner, and may not advance pending tasks.
125 via a pseudo-synchronous runner, and may not advance pending tasks.
126
126
127 Change to Nested Embed
127 Change to Nested Embed
128 ~~~~~~~~~~~~~~~~~~~~~~
128 ~~~~~~~~~~~~~~~~~~~~~~
129
129
130 The introduction of the ability to run async code had some effect on the
130 The introduction of the ability to run async code had some effect on the
131 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
131 ``IPython.embed()`` API. By default embed will not allow you to run asynchronous
132 code unless a event loop is specified.
132 code unless a event loop is specified.
133
133
134 Effects on Magics
134 Effects on Magics
135 ~~~~~~~~~~~~~~~~~
135 ~~~~~~~~~~~~~~~~~
136
136
137 Some magics will not work with Async, and will need updates. Contribution
137 Some magics will not work with Async, and will need updates. Contribution
138 welcome.
138 welcome.
139
139
140 Expected Future changes
140 Expected Future changes
141 ~~~~~~~~~~~~~~~~~~~~~~~
141 ~~~~~~~~~~~~~~~~~~~~~~~
142
142
143 We expect more internal but public IPython function to become ``async``, and
143 We expect more internal but public IPython function to become ``async``, and
144 will likely end up having a persisting event loop while IPython is running.
144 will likely end up having a persisting event loop while IPython is running.
145
145
146 Thanks
146 Thanks
147 ~~~~~~
147 ~~~~~~
148
148
149 This took more than a year in the making, and the code was rebased a number of
149 This took more than a year in the making, and the code was rebased a number of
150 time leading to commit authorship that may have been lost in the final
150 time leading to commit authorship that may have been lost in the final
151 Pull-Request. Huge thanks to many people for contribution, discussion, code,
151 Pull-Request. Huge thanks to many people for contribution, discussion, code,
152 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
152 documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor,
153 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
153 minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many others.
154
154
155
155
156 Autoreload Improvement
156 Autoreload Improvement
157 ----------------------
157 ----------------------
158
158
159 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
159 The magic :magic:`%autoreload 2 <autoreload>` now captures new methods added to
160 classes. Earlier, only methods existing as of the initial import were being
160 classes. Earlier, only methods existing as of the initial import were being
161 tracked and updated.
161 tracked and updated.
162
162
163 This new feature helps dual environment development - Jupyter+IDE - where the
163 This new feature helps dual environment development - Jupyter+IDE - where the
164 code gradually moves from notebook cells to package files, as it gets
164 code gradually moves from notebook cells to package files, as it gets
165 structured.
165 structured.
166
166
167 **Example**: An instance of the class ``MyClass`` will be able to access the
167 **Example**: An instance of the class ``MyClass`` will be able to access the
168 method ``cube()`` after it is uncommented and the file ``file1.py`` saved on
168 method ``cube()`` after it is uncommented and the file ``file1.py`` saved on
169 disk.
169 disk.
170
170
171
171
172 ..code::
172 ..code::
173
173
174 # notebook
174 # notebook
175
175
176 from mymodule import MyClass
176 from mymodule import MyClass
177 first = MyClass(5)
177 first = MyClass(5)
178
178
179 .. code::
179 .. code::
180
180
181 # mymodule/file1.py
181 # mymodule/file1.py
182
182
183 class MyClass:
183 class MyClass:
184
184
185 def __init__(self, a=10):
185 def __init__(self, a=10):
186 self.a = a
186 self.a = a
187
187
188 def square(self):
188 def square(self):
189 print('compute square')
189 print('compute square')
190 return self.a*self.a
190 return self.a*self.a
191
191
192 # def cube(self):
192 # def cube(self):
193 # print('compute cube')
193 # print('compute cube')
194 # return self.a*self.a*self.a
194 # return self.a*self.a*self.a
195
195
196
196
197
197
198
198
199 Misc
199 Misc
200 ----
200 ----
201
201
202 The autoindent feature that was deprecated in 5.x was re-enabled and
202 The autoindent feature that was deprecated in 5.x was re-enabled and
203 un-deprecated in :ghpull:`11257`
203 un-deprecated in :ghpull:`11257`
204
204
205 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
205 Make :magic:`%run -n -i ... <run>` work correctly. Earlier, if :magic:`%run` was
206 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
206 passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308`
207
207
208
208
209 The :cellmagic:`%%script`` (as well as :cellmagic:`%%bash``,
209 The :cellmagic:`%%script` (as well as :cellmagic:`%%bash`,
210 :cellmagic:`%%ruby``... ) cell magics now raise by default if the return code of
210 :cellmagic:`%%ruby`... ) cell magics now raise by default if the return code of
211 the given code is non-zero (thus halting execution of further cells in a
211 the given code is non-zero (thus halting execution of further cells in a
212 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
212 notebook). The behavior can be disable by passing the ``--no-raise-error`` flag.
213
213
214
214
215 Deprecations
215 Deprecations
216 ------------
216 ------------
217
217
218 A couple of unused function and methods have been deprecated and will be removed
218 A couple of unused function and methods have been deprecated and will be removed
219 in future versions:
219 in future versions:
220
220
221 - ``IPython.utils.io.raw_print_err``
221 - ``IPython.utils.io.raw_print_err``
222 - ``IPython.utils.io.raw_print``
222 - ``IPython.utils.io.raw_print``
223
223
224
224
225 Backwards incompatible changes
225 Backwards incompatible changes
226 ------------------------------
226 ------------------------------
227
227
228 * The API for transforming input before it is parsed as Python code has been
228 * The API for transforming input before it is parsed as Python code has been
229 completely redesigned, and any custom input transformations will need to be
229 completely redesigned, and any custom input transformations will need to be
230 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
230 rewritten. See :doc:`/config/inputtransforms` for details of the new API.
General Comments 0
You need to be logged in to leave comments. Login now