##// END OF EJS Templates
feat: remove deprecated code & files ⚰️
Meysam Azad -
Show More
@@ -1,149 +1,144 b''
1 1 # encoding: utf-8
2 2 """
3 3 IPython: tools for interactive and parallel computing in Python.
4 4
5 5 https://ipython.org
6 6 """
7 7 #-----------------------------------------------------------------------------
8 8 # Copyright (c) 2008-2011, IPython Development Team.
9 9 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 10 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 11 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 12 #
13 13 # Distributed under the terms of the Modified BSD License.
14 14 #
15 15 # The full license is in the file COPYING.txt, distributed with this software.
16 16 #-----------------------------------------------------------------------------
17 17
18 18 #-----------------------------------------------------------------------------
19 19 # Imports
20 20 #-----------------------------------------------------------------------------
21 21
22 22 import os
23 23 import sys
24 24
25 25 #-----------------------------------------------------------------------------
26 26 # Setup everything
27 27 #-----------------------------------------------------------------------------
28 28
29 29 # Don't forget to also update setup.py when this changes!
30 30 if sys.version_info < (3, 6):
31 31 raise ImportError(
32 32 """
33 33 IPython 7.10+ supports Python 3.6 and above.
34 34 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
35 35 Python 3.3 and 3.4 were supported up to IPython 6.x.
36 36 Python 3.5 was supported with IPython 7.0 to 7.9.
37 37
38 38 See IPython `README.rst` file for more information:
39 39
40 40 https://github.com/ipython/ipython/blob/master/README.rst
41 41
42 42 """)
43 43
44 # Make it easy to import extensions - they are always directly on pythonpath.
45 # Therefore, non-IPython modules can be added to extensions directory.
46 # This should probably be in ipapp.py.
47 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
48
49 44 #-----------------------------------------------------------------------------
50 45 # Setup the top level names
51 46 #-----------------------------------------------------------------------------
52 47
53 48 from .core.getipython import get_ipython
54 49 from .core import release
55 50 from .core.application import Application
56 51 from .terminal.embed import embed
57 52
58 53 from .core.interactiveshell import InteractiveShell
59 54 from .testing import test
60 55 from .utils.sysinfo import sys_info
61 56 from .utils.frame import extract_module_locals
62 57
63 58 # Release data
64 59 __author__ = '%s <%s>' % (release.author, release.author_email)
65 60 __license__ = release.license
66 61 __version__ = release.version
67 62 version_info = release.version_info
68 63
69 64 def embed_kernel(module=None, local_ns=None, **kwargs):
70 65 """Embed and start an IPython kernel in a given scope.
71 66
72 67 If you don't want the kernel to initialize the namespace
73 68 from the scope of the surrounding function,
74 69 and/or you want to load full IPython configuration,
75 70 you probably want `IPython.start_kernel()` instead.
76 71
77 72 Parameters
78 73 ----------
79 74 module : types.ModuleType, optional
80 75 The module to load into IPython globals (default: caller)
81 76 local_ns : dict, optional
82 77 The namespace to load into IPython user namespace (default: caller)
83 78 **kwargs : various, optional
84 79 Further keyword args are relayed to the IPKernelApp constructor,
85 80 allowing configuration of the Kernel. Will only have an effect
86 81 on the first embed_kernel call for a given process.
87 82 """
88 83
89 84 (caller_module, caller_locals) = extract_module_locals(1)
90 85 if module is None:
91 86 module = caller_module
92 87 if local_ns is None:
93 88 local_ns = caller_locals
94 89
95 90 # Only import .zmq when we really need it
96 91 from ipykernel.embed import embed_kernel as real_embed_kernel
97 92 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
98 93
99 94 def start_ipython(argv=None, **kwargs):
100 95 """Launch a normal IPython instance (as opposed to embedded)
101 96
102 97 `IPython.embed()` puts a shell in a particular calling scope,
103 98 such as a function or method for debugging purposes,
104 99 which is often not desirable.
105 100
106 101 `start_ipython()` does full, regular IPython initialization,
107 102 including loading startup files, configuration, etc.
108 103 much of which is skipped by `embed()`.
109 104
110 105 This is a public API method, and will survive implementation changes.
111 106
112 107 Parameters
113 108 ----------
114 109 argv : list or None, optional
115 110 If unspecified or None, IPython will parse command-line options from sys.argv.
116 111 To prevent any command-line parsing, pass an empty list: `argv=[]`.
117 112 user_ns : dict, optional
118 113 specify this dictionary to initialize the IPython user namespace with particular values.
119 114 **kwargs : various, optional
120 115 Any other kwargs will be passed to the Application constructor,
121 116 such as `config`.
122 117 """
123 118 from IPython.terminal.ipapp import launch_new_instance
124 119 return launch_new_instance(argv=argv, **kwargs)
125 120
126 121 def start_kernel(argv=None, **kwargs):
127 122 """Launch a normal IPython kernel instance (as opposed to embedded)
128 123
129 124 `IPython.embed_kernel()` puts a shell in a particular calling scope,
130 125 such as a function or method for debugging purposes,
131 126 which is often not desirable.
132 127
133 128 `start_kernel()` does full, regular IPython initialization,
134 129 including loading startup files, configuration, etc.
135 130 much of which is skipped by `embed()`.
136 131
137 132 Parameters
138 133 ----------
139 134 argv : list or None, optional
140 135 If unspecified or None, IPython will parse command-line options from sys.argv.
141 136 To prevent any command-line parsing, pass an empty list: `argv=[]`.
142 137 user_ns : dict, optional
143 138 specify this dictionary to initialize the IPython user namespace with particular values.
144 139 **kwargs : various, optional
145 140 Any other kwargs will be passed to the Application constructor,
146 141 such as `config`.
147 142 """
148 143 from IPython.kernel.zmq.kernelapp import launch_new_instance
149 144 return launch_new_instance(argv=argv, **kwargs)
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now