Skip to content

Commit

Permalink
Merge pull request #1 from illright/upstream
Browse files Browse the repository at this point in the history
Pull upstream changes
  • Loading branch information
illright committed Apr 19, 2021
2 parents eb9b2bd + 5d7ef55 commit 58f8486
Show file tree
Hide file tree
Showing 38 changed files with 702 additions and 263 deletions.
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
# <full commit hash> # initial black-format
# <full commit hash> # rename something internal
6e748726282d1acb9a4f9f264ee679c474c4b8f5 # Apply pygrade --36plus on IPython/core/tests/test_inputtransformer.py.
0233e65d8086d0ec34acb8685b7a5411633f0899 # apply pyupgrade to IPython/extensions/tests/test_autoreload.py
a6a7e4dd7e51b892147895006d3a2a6c34b79ae6 # apply black to IPython/extensions/tests/test_autoreload.py
c5ca5a8f25432dfd6b9eccbbe446a8348bf37cfa # apply pyupgrade to IPython/extensions/autoreload.py
50624b84ccdece781750f5eb635a9efbf2fe30d6 # apply black to IPython/extensions/autoreload.py
b7aaa47412b96379198705955004930c57f9d74a # apply pyupgrade to IPython/extensions/autoreload.py
9c7476a88af3e567426b412f1b3c778401d8f6aa # apply black to IPython/extensions/autoreload.py
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@ If it's a generic Python/Jupyter question, try other forums or discourse.jupyter
If you are unsure, it's ok to post here, though, there are few maintainer so you might not get a fast response.
Ability of maintainers to spend time and resources on project like IPython is heavily influenced by US politics, and the current government policies have been harmful to the IPython Maintainers and Community.
If you are on the fence on who to vote for or wether to vote, please cast your vote in for the democrat party in the US.
-->
5 changes: 3 additions & 2 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ jobs:
pip install mypy pyflakes flake8
- name: Lint with mypy
run: |
mypy IPython/terminal/ptutils.py
mypy IPython/core/c*.py
mypy -p IPython.terminal
mypy -p IPython.core.magics
- name: Lint with pyflakes
run: |
flake8 IPython/core/magics/script.py
flake8 IPython/core/magics/packaging.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ docs/man/*.gz
docs/source/api/generated
docs/source/config/options
docs/source/config/shortcuts/*.csv
docs/source/savefig
docs/source/interactive/magics-generated.txt
docs/gh-pages
jupyter_notebook/notebook/static/mathjax
Expand Down
27 changes: 12 additions & 15 deletions IPython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,19 @@

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.
Expand All @@ -99,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`.
"""
Expand All @@ -127,24 +125,23 @@ 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`.
"""
Expand Down
2 changes: 1 addition & 1 deletion IPython/core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def unset_crashhandler():

def excepthook(self, etype, evalue, tb):
"""this is sys.excepthook after init_crashhandler
set self.verbose_crash=True to use our full crashhandler, instead of
a regular traceback with a short message (crash_handler_lite)
"""
Expand Down
4 changes: 2 additions & 2 deletions IPython/core/autocall.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def __init__(self, ip=None):

def set_ip(self, ip):
""" Will be used to set _ip point to current ipython instance b/f call
Override this method if you don't want this to happen.
"""
self._ip = ip

Expand Down
16 changes: 8 additions & 8 deletions IPython/core/compilerop.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ def get_code_name(self, raw_code, transformed_code, number):
Parameters
----------
raw_code : str
The raw cell code.
The raw cell code.
transformed_code : str
The executable Python source code to cache and compile.
The executable Python source code to cache and compile.
number : int
A number which forms part of the code's name. Used for the execution
counter.
A number which forms part of the code's name. Used for the execution
counter.
Returns
-------
Expand All @@ -137,12 +137,12 @@ def cache(self, transformed_code, number=0, raw_code=None):
Parameters
----------
transformed_code : str
The executable Python source code to cache and compile.
The executable Python source code to cache and compile.
number : int
A number which forms part of the code's name. Used for the execution
counter.
A number which forms part of the code's name. Used for the execution
counter.
raw_code : str
The raw code before transformation, if None, set to `transformed_code`.
The raw code before transformation, if None, set to `transformed_code`.
Returns
-------
Expand Down
24 changes: 12 additions & 12 deletions IPython/core/completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,9 @@ def _deduplicate_completions(text: str, completions: _IC)-> _IC:
Parameters
----------
text: str
text : str
text that should be completed.
completions: Iterator[Completion]
completions : Iterator[Completion]
iterator over the completions to deduplicate
Yields
Expand Down Expand Up @@ -474,9 +474,9 @@ def rectify_completions(text: str, completions: _IC, *, _debug=False)->_IC:
Parameters
----------
text: str
text : str
text that should be completed.
completions: Iterator[Completion]
completions : Iterator[Completion]
iterator over the completions to rectify
Notes
Expand Down Expand Up @@ -763,13 +763,13 @@ def match_dict_keys(keys: List[Union[str, bytes, Tuple[Union[str, bytes]]]], pre
Parameters
----------
keys:
keys
list of keys in dictionary currently being completed.
prefix:
prefix
Part of the text already typed by the user. E.g. `mydict[b'fo`
delims:
delims
String of delimiters to consider when finding the current key.
extra_prefix: optional
extra_prefix : optional
Part of the text already typed in multi-key index cases. E.g. for
`mydict['foo', "bar", 'b`, this would be `('foo', 'bar')`.
Expand Down Expand Up @@ -993,7 +993,7 @@ def _formatparamchildren(parameter) -> str:
Parameters
----------
parameter:
parameter
Jedi's function `Param`
Returns
Expand All @@ -1013,7 +1013,7 @@ def _make_signature(completion)-> str:
Parameters
----------
completion: jedi.Completion
completion : jedi.Completion
object does not complete a function type
Returns
Expand Down Expand Up @@ -1854,9 +1854,9 @@ def completions(self, text: str, offset: int)->Iterator[Completion]:
Parameters
----------
text:str
text : str
Full text of the current input, multi line string.
offset:int
offset : int
Integer representing the position of the cursor in ``text``. Offset
is 0-based indexed.
Expand Down
10 changes: 2 additions & 8 deletions IPython/core/crashhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,19 @@ def __init__(self, app, contact_name=None, contact_email=None,
Parameters
----------
app : Application
app : Application
A running :class:`Application` instance, which will be queried at
crash time for internal information.
contact_name : str
A string with the name of the person to contact.
contact_email : str
A string with the email address of the contact.
bug_tracker : str
A string with the URL for your project's bug tracker.
show_crash_traceback : bool
If false, don't print the crash traceback on stderr, only generate
the on-disk report
Non-argument instance attributes:
Non-argument instance attributes
These instances contain some non-argument attributes which allow for
further customization of the crash handler's behavior. Please see the
source for further details.
Expand Down
1 change: 0 additions & 1 deletion IPython/core/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def __init__(self, colors=None):
Parameters
----------
colors : str, optional
The name of the color scheme to use, it must be one of IPython's
valid color schemes. If not given, the function will default to
Expand Down

0 comments on commit 58f8486

Please sign in to comment.