summaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py3/IPython/__init__.py
diff options
context:
space:
mode:
authorrobot-contrib <[email protected]>2022-05-18 00:43:36 +0300
committerrobot-contrib <[email protected]>2022-05-18 00:43:36 +0300
commit9e5f436a8b2a27bcc7802e443ea3ef3e41a82a75 (patch)
tree78b522cab9f76336e62064d4d8ff7c897659b20e /contrib/python/ipython/py3/IPython/__init__.py
parent8113a823ffca6451bb5ff8f0334560885a939a24 (diff)
Update contrib/python/ipython/py3 to 8.3.0
ref:e84342d4d30476f9148137f37fd0c6405fd36f55
Diffstat (limited to 'contrib/python/ipython/py3/IPython/__init__.py')
-rw-r--r--contrib/python/ipython/py3/IPython/__init__.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/contrib/python/ipython/py3/IPython/__init__.py b/contrib/python/ipython/py3/IPython/__init__.py
index c17ec76a602..7ebb80b3621 100644
--- a/contrib/python/ipython/py3/IPython/__init__.py
+++ b/contrib/python/ipython/py3/IPython/__init__.py
@@ -1,4 +1,3 @@
-# encoding: utf-8
"""
IPython: tools for interactive and parallel computing in Python.
@@ -27,24 +26,22 @@ import sys
#-----------------------------------------------------------------------------
# Don't forget to also update setup.py when this changes!
-if sys.version_info < (3, 6):
+if sys.version_info < (3, 8):
raise ImportError(
-"""
-IPython 7.10+ supports Python 3.6 and above.
+ """
+IPython 8+ supports Python 3.8 and above, following NEP 29.
When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
Python 3.3 and 3.4 were supported up to IPython 6.x.
Python 3.5 was supported with IPython 7.0 to 7.9.
+Python 3.6 was supported with IPython up to 7.16.
+Python 3.7 was still supported with the 7.x branch.
See IPython `README.rst` file for more information:
https://github.com/ipython/ipython/blob/master/README.rst
-""")
-
-# Make it easy to import extensions - they are always directly on pythonpath.
-# Therefore, non-IPython modules can be added to extensions directory.
-# This should probably be in ipapp.py.
-sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
+"""
+ )
#-----------------------------------------------------------------------------
# Setup the top level names
@@ -56,7 +53,6 @@ from .core.application import Application
from .terminal.embed import embed
from .core.interactiveshell import InteractiveShell
-from .testing import test
from .utils.sysinfo import sys_info
from .utils.frame import extract_module_locals
@@ -72,20 +68,19 @@ __patched_cves__ = {"CVE-2022-21699"}
def embed_kernel(module=None, local_ns=None, **kwargs):
"""Embed and start an IPython kernel in a given scope.
-
+
If you don't want the kernel to initialize the namespace
from the scope of the surrounding function,
and/or you want to load full IPython configuration,
you probably want `IPython.start_kernel()` instead.
-
+
Parameters
----------
module : types.ModuleType, optional
The module to load into IPython globals (default: caller)
local_ns : dict, optional
The namespace to load into IPython user namespace (default: caller)
-
- kwargs : various, optional
+ **kwargs : various, optional
Further keyword args are relayed to the IPKernelApp constructor,
allowing configuration of the Kernel. Will only have an effect
on the first embed_kernel call for a given process.
@@ -103,26 +98,25 @@ def embed_kernel(module=None, local_ns=None, **kwargs):
def start_ipython(argv=None, **kwargs):
"""Launch a normal IPython instance (as opposed to embedded)
-
+
`IPython.embed()` puts a shell in a particular calling scope,
such as a function or method for debugging purposes,
which is often not desirable.
-
+
`start_ipython()` does full, regular IPython initialization,
including loading startup files, configuration, etc.
much of which is skipped by `embed()`.
-
+
This is a public API method, and will survive implementation changes.
-
+
Parameters
----------
-
argv : list or None, optional
If unspecified or None, IPython will parse command-line options from sys.argv.
To prevent any command-line parsing, pass an empty list: `argv=[]`.
user_ns : dict, optional
specify this dictionary to initialize the IPython user namespace with particular values.
- kwargs : various, optional
+ **kwargs : various, optional
Any other kwargs will be passed to the Application constructor,
such as `config`.
"""
@@ -131,26 +125,32 @@ def start_ipython(argv=None, **kwargs):
def start_kernel(argv=None, **kwargs):
"""Launch a normal IPython kernel instance (as opposed to embedded)
-
+
`IPython.embed_kernel()` puts a shell in a particular calling scope,
such as a function or method for debugging purposes,
which is often not desirable.
-
+
`start_kernel()` does full, regular IPython initialization,
including loading startup files, configuration, etc.
much of which is skipped by `embed()`.
-
+
Parameters
----------
-
argv : list or None, optional
If unspecified or None, IPython will parse command-line options from sys.argv.
To prevent any command-line parsing, pass an empty list: `argv=[]`.
user_ns : dict, optional
specify this dictionary to initialize the IPython user namespace with particular values.
- kwargs : various, optional
+ **kwargs : various, optional
Any other kwargs will be passed to the Application constructor,
such as `config`.
"""
- from IPython.kernel.zmq.kernelapp import launch_new_instance
+ import warnings
+
+ warnings.warn(
+ "start_kernel is deprecated since IPython 8.0, use from `ipykernel.kernelapp.launch_new_instance`",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ from ipykernel.kernelapp import launch_new_instance
return launch_new_instance(argv=argv, **kwargs)