Skip to content

Commit 8aa9031

Browse files
committed
fix: conflict resolved
2 parents 4d217c0 + 47693ea commit 8aa9031

File tree

20,433 files changed

+6476774
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

20,433 files changed

+6476774
-99
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ __pycache__/
2323
*.pyd
2424
*.log
2525
.vscode/
26-
.idea/
26+
.idea/
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */
2+
3+
/* Greenlet object interface */
4+
5+
#ifndef Py_GREENLETOBJECT_H
6+
#define Py_GREENLETOBJECT_H
7+
8+
9+
#include <Python.h>
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
/* This is deprecated and undocumented. It does not change. */
16+
#define GREENLET_VERSION "1.0.0"
17+
18+
#ifndef GREENLET_MODULE
19+
#define implementation_ptr_t void*
20+
#endif
21+
22+
typedef struct _greenlet {
23+
PyObject_HEAD
24+
PyObject* weakreflist;
25+
PyObject* dict;
26+
implementation_ptr_t pimpl;
27+
} PyGreenlet;
28+
29+
#define PyGreenlet_Check(op) (op && PyObject_TypeCheck(op, &PyGreenlet_Type))
30+
31+
32+
/* C API functions */
33+
34+
/* Total number of symbols that are exported */
35+
#define PyGreenlet_API_pointers 12
36+
37+
#define PyGreenlet_Type_NUM 0
38+
#define PyExc_GreenletError_NUM 1
39+
#define PyExc_GreenletExit_NUM 2
40+
41+
#define PyGreenlet_New_NUM 3
42+
#define PyGreenlet_GetCurrent_NUM 4
43+
#define PyGreenlet_Throw_NUM 5
44+
#define PyGreenlet_Switch_NUM 6
45+
#define PyGreenlet_SetParent_NUM 7
46+
47+
#define PyGreenlet_MAIN_NUM 8
48+
#define PyGreenlet_STARTED_NUM 9
49+
#define PyGreenlet_ACTIVE_NUM 10
50+
#define PyGreenlet_GET_PARENT_NUM 11
51+
52+
#ifndef GREENLET_MODULE
53+
/* This section is used by modules that uses the greenlet C API */
54+
static void** _PyGreenlet_API = NULL;
55+
56+
# define PyGreenlet_Type \
57+
(*(PyTypeObject*)_PyGreenlet_API[PyGreenlet_Type_NUM])
58+
59+
# define PyExc_GreenletError \
60+
((PyObject*)_PyGreenlet_API[PyExc_GreenletError_NUM])
61+
62+
# define PyExc_GreenletExit \
63+
((PyObject*)_PyGreenlet_API[PyExc_GreenletExit_NUM])
64+
65+
/*
66+
* PyGreenlet_New(PyObject *args)
67+
*
68+
* greenlet.greenlet(run, parent=None)
69+
*/
70+
# define PyGreenlet_New \
71+
(*(PyGreenlet * (*)(PyObject * run, PyGreenlet * parent)) \
72+
_PyGreenlet_API[PyGreenlet_New_NUM])
73+
74+
/*
75+
* PyGreenlet_GetCurrent(void)
76+
*
77+
* greenlet.getcurrent()
78+
*/
79+
# define PyGreenlet_GetCurrent \
80+
(*(PyGreenlet * (*)(void)) _PyGreenlet_API[PyGreenlet_GetCurrent_NUM])
81+
82+
/*
83+
* PyGreenlet_Throw(
84+
* PyGreenlet *greenlet,
85+
* PyObject *typ,
86+
* PyObject *val,
87+
* PyObject *tb)
88+
*
89+
* g.throw(...)
90+
*/
91+
# define PyGreenlet_Throw \
92+
(*(PyObject * (*)(PyGreenlet * self, \
93+
PyObject * typ, \
94+
PyObject * val, \
95+
PyObject * tb)) \
96+
_PyGreenlet_API[PyGreenlet_Throw_NUM])
97+
98+
/*
99+
* PyGreenlet_Switch(PyGreenlet *greenlet, PyObject *args)
100+
*
101+
* g.switch(*args, **kwargs)
102+
*/
103+
# define PyGreenlet_Switch \
104+
(*(PyObject * \
105+
(*)(PyGreenlet * greenlet, PyObject * args, PyObject * kwargs)) \
106+
_PyGreenlet_API[PyGreenlet_Switch_NUM])
107+
108+
/*
109+
* PyGreenlet_SetParent(PyObject *greenlet, PyObject *new_parent)
110+
*
111+
* g.parent = new_parent
112+
*/
113+
# define PyGreenlet_SetParent \
114+
(*(int (*)(PyGreenlet * greenlet, PyGreenlet * nparent)) \
115+
_PyGreenlet_API[PyGreenlet_SetParent_NUM])
116+
117+
/*
118+
* PyGreenlet_GetParent(PyObject* greenlet)
119+
*
120+
* return greenlet.parent;
121+
*
122+
* This could return NULL even if there is no exception active.
123+
* If it does not return NULL, you are responsible for decrementing the
124+
* reference count.
125+
*/
126+
# define PyGreenlet_GetParent \
127+
(*(PyGreenlet* (*)(PyGreenlet*)) \
128+
_PyGreenlet_API[PyGreenlet_GET_PARENT_NUM])
129+
130+
/*
131+
* deprecated, undocumented alias.
132+
*/
133+
# define PyGreenlet_GET_PARENT PyGreenlet_GetParent
134+
135+
# define PyGreenlet_MAIN \
136+
(*(int (*)(PyGreenlet*)) \
137+
_PyGreenlet_API[PyGreenlet_MAIN_NUM])
138+
139+
# define PyGreenlet_STARTED \
140+
(*(int (*)(PyGreenlet*)) \
141+
_PyGreenlet_API[PyGreenlet_STARTED_NUM])
142+
143+
# define PyGreenlet_ACTIVE \
144+
(*(int (*)(PyGreenlet*)) \
145+
_PyGreenlet_API[PyGreenlet_ACTIVE_NUM])
146+
147+
148+
149+
150+
/* Macro that imports greenlet and initializes C API */
151+
/* NOTE: This has actually moved to ``greenlet._greenlet._C_API``, but we
152+
keep the older definition to be sure older code that might have a copy of
153+
the header still works. */
154+
# define PyGreenlet_Import() \
155+
{ \
156+
_PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \
157+
}
158+
159+
#endif /* GREENLET_MODULE */
160+
161+
#ifdef __cplusplus
162+
}
163+
#endif
164+
#endif /* !Py_GREENLETOBJECT_H */
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# PYTHON_ARGCOMPLETE_OK
2+
"""
3+
IPython: tools for interactive and parallel computing in Python.
4+
5+
https://ipython.org
6+
"""
7+
#-----------------------------------------------------------------------------
8+
# Copyright (c) 2008-2011, IPython Development Team.
9+
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10+
# Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11+
# Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12+
#
13+
# Distributed under the terms of the Modified BSD License.
14+
#
15+
# The full license is in the file COPYING.txt, distributed with this software.
16+
#-----------------------------------------------------------------------------
17+
18+
#-----------------------------------------------------------------------------
19+
# Imports
20+
#-----------------------------------------------------------------------------
21+
22+
import sys
23+
import warnings
24+
25+
#-----------------------------------------------------------------------------
26+
# Setup everything
27+
#-----------------------------------------------------------------------------
28+
29+
# Don't forget to also update setup.py when this changes!
30+
if sys.version_info < (3, 11):
31+
raise ImportError(
32+
"""
33+
IPython 8.31+ supports Python 3.11 and above, following SPEC0
34+
IPython 8.19+ supports Python 3.10 and above, following SPEC0.
35+
IPython 8.13+ supports Python 3.9 and above, following NEP 29.
36+
IPython 8.0-8.12 supports Python 3.8 and above, following NEP 29.
37+
When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
38+
Python 3.3 and 3.4 were supported up to IPython 6.x.
39+
Python 3.5 was supported with IPython 7.0 to 7.9.
40+
Python 3.6 was supported with IPython up to 7.16.
41+
Python 3.7 was still supported with the 7.x branch.
42+
43+
See IPython `README.rst` file for more information:
44+
45+
https://github.com/ipython/ipython/blob/main/README.rst
46+
47+
"""
48+
)
49+
50+
#-----------------------------------------------------------------------------
51+
# Setup the top level names
52+
#-----------------------------------------------------------------------------
53+
54+
from .core.getipython import get_ipython
55+
from .core import release
56+
from .core.application import Application
57+
from .terminal.embed import embed
58+
59+
from .core.interactiveshell import InteractiveShell
60+
from .utils.sysinfo import sys_info
61+
from .utils.frame import extract_module_locals
62+
63+
__all__ = ["start_ipython", "embed", "embed_kernel"]
64+
65+
# Release data
66+
__author__ = '%s <%s>' % (release.author, release.author_email)
67+
__license__ = release.license
68+
__version__ = release.version
69+
version_info = release.version_info
70+
# list of CVEs that should have been patched in this release.
71+
# this is informational and should not be relied upon.
72+
__patched_cves__ = {"CVE-2022-21699", "CVE-2023-24816"}
73+
74+
75+
def embed_kernel(module=None, local_ns=None, **kwargs):
76+
"""Embed and start an IPython kernel in a given scope.
77+
78+
If you don't want the kernel to initialize the namespace
79+
from the scope of the surrounding function,
80+
and/or you want to load full IPython configuration,
81+
you probably want `IPython.start_kernel()` instead.
82+
83+
This is a deprecated alias for `ipykernel.embed.embed_kernel()`,
84+
to be removed in the future.
85+
You should import directly from `ipykernel.embed`; this wrapper
86+
fails anyway if you don't have `ipykernel` package installed.
87+
88+
Parameters
89+
----------
90+
module : types.ModuleType, optional
91+
The module to load into IPython globals (default: caller)
92+
local_ns : dict, optional
93+
The namespace to load into IPython user namespace (default: caller)
94+
**kwargs : various, optional
95+
Further keyword args are relayed to the IPKernelApp constructor,
96+
such as `config`, a traitlets :class:`Config` object (see :ref:`configure_start_ipython`),
97+
allowing configuration of the kernel. Will only have an effect
98+
on the first embed_kernel call for a given process.
99+
"""
100+
101+
warnings.warn(
102+
"import embed_kernel from ipykernel.embed directly (since 2013)."
103+
" Importing from IPython will be removed in the future",
104+
DeprecationWarning,
105+
stacklevel=2,
106+
)
107+
108+
(caller_module, caller_locals) = extract_module_locals(1)
109+
if module is None:
110+
module = caller_module
111+
if local_ns is None:
112+
local_ns = dict(**caller_locals)
113+
114+
# Only import .zmq when we really need it
115+
from ipykernel.embed import embed_kernel as real_embed_kernel
116+
real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
117+
118+
def start_ipython(argv=None, **kwargs):
119+
"""Launch a normal IPython instance (as opposed to embedded)
120+
121+
`IPython.embed()` puts a shell in a particular calling scope,
122+
such as a function or method for debugging purposes,
123+
which is often not desirable.
124+
125+
`start_ipython()` does full, regular IPython initialization,
126+
including loading startup files, configuration, etc.
127+
much of which is skipped by `embed()`.
128+
129+
This is a public API method, and will survive implementation changes.
130+
131+
Parameters
132+
----------
133+
argv : list or None, optional
134+
If unspecified or None, IPython will parse command-line options from sys.argv.
135+
To prevent any command-line parsing, pass an empty list: `argv=[]`.
136+
user_ns : dict, optional
137+
specify this dictionary to initialize the IPython user namespace with particular values.
138+
**kwargs : various, optional
139+
Any other kwargs will be passed to the Application constructor,
140+
such as `config`, a traitlets :class:`Config` object (see :ref:`configure_start_ipython`),
141+
allowing configuration of the instance (see :ref:`terminal_options`).
142+
"""
143+
from IPython.terminal.ipapp import launch_new_instance
144+
return launch_new_instance(argv=argv, **kwargs)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PYTHON_ARGCOMPLETE_OK
2+
# encoding: utf-8
3+
"""Terminal-based IPython entry point."""
4+
# -----------------------------------------------------------------------------
5+
# Copyright (c) 2012, IPython Development Team.
6+
#
7+
# Distributed under the terms of the Modified BSD License.
8+
#
9+
# The full license is in the file COPYING.txt, distributed with this software.
10+
# -----------------------------------------------------------------------------
11+
12+
from IPython import start_ipython
13+
14+
start_ipython()

.venv/Lib/site-packages/IPython/core/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)