Skip to content

Commit

Permalink
Merge branch 'ipython:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightyagami1 committed Jun 5, 2021
2 parents b2ca9a6 + 90c1297 commit 0610a35
Show file tree
Hide file tree
Showing 97 changed files with 2,106 additions and 997 deletions.
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
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
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.
-->
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,26 @@
name: Build docs

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Graphviz
run: |
sudo apt-get update
sudo apt-get install graphviz
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install -r docs/requirements.txt
- name: Build docs
run: |
python tools/fixup_whats_new_pr.py
make -C docs/ html SPHINXOPTS="-W"
9 changes: 5 additions & 4 deletions .github/workflows/mypy.yml
Expand Up @@ -2,9 +2,9 @@ name: Run MyPy

on:
push:
branches: [ master ]
branches: [ master, 7.x]
pull_request:
branches: [ master ]
branches: [ master, 7.x]

jobs:
build:
Expand All @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Expand Up @@ -5,9 +5,9 @@ name: Python package

on:
push:
branches: [ master ]
branches: [ master, 7.x ]
pull_request:
branches: [ master ]
branches: [ master, 7.x ]

jobs:
build:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install darker
pip install darker isort
- name: Lint with darker
run: |
darker -r 60625f241f298b5039cb2debc365db38aa7bb522 --check --diff . || (
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test-osx.yml
@@ -0,0 +1,23 @@
name: Run tests on OSX

on: [push, pull_request]

jobs:
test:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install and update Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -e file://$PWD#egg=ipython[test]
python -m pip install --upgrade --upgrade-strategy eager trio curio
python -m pip install --upgrade pytest pytest-trio 'matplotlib!=3.2.0'
python -m pip install --upgrade anyio
- name: pytest
run: pytest
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,36 @@
name: Run tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install and update Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -e file://$PWD#egg=ipython[test]
python -m pip install --upgrade --upgrade-strategy eager trio curio
python -m pip install --upgrade pytest pytest-trio 'matplotlib!=3.2.0'
python -m pip install --upgrade check-manifest pytest-cov anyio
- name: Check manifest
run: check-manifest
- name: iptest
run: |
cd /tmp && iptest --coverage xml && cd -
cp /tmp/ipy_coverage.xml ./
cp /tmp/.coverage ./
- name: pytest
run: |
pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
1 change: 1 addition & 0 deletions .gitignore
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
105 changes: 0 additions & 105 deletions .travis.yml

This file was deleted.

27 changes: 12 additions & 15 deletions IPython/__init__.py
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
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
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

0 comments on commit 0610a35

Please sign in to comment.