Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 778dac1

Browse files
committed
pyflakes to avoid missing imports
1 parent d178140 commit 778dac1

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = W293,E301,E271,E265,W291,E722,E302,C901,E225,E128,E122,E226,E231
3+
max-line-length = 160
4+
exclude = tests/*
5+
max-complexity = 10

.github/workflows/mypy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
pip install mypy
26+
pip install mypy pyflakes flake8
2727
- name: Lint with mypy
2828
run: |
2929
mypy IPython/terminal/ptutils.py
3030
mypy IPython/core/c*.py
31+
- name: Lint with pyflakes
32+
run: |
33+
flake8 IPython/core/magics/script.py

IPython/core/magics/script.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
Magics, magics_class, line_magic, cell_magic
1919
)
2020
from IPython.lib.backgroundjobs import BackgroundJobManager
21-
from IPython.utils import py3compat
2221
from IPython.utils.process import arg_split
2322
from traitlets import List, Dict, default
2423

@@ -139,7 +138,7 @@ def _make_script_magic(self, name):
139138
def named_script_magic(line, cell):
140139
# if line, add it as cl-flags
141140
if line:
142-
line = "%s %s" % (script, line)
141+
line = "%s %s" % (script, line)
143142
else:
144143
line = script
145144
return self.shebang(line, cell)
@@ -262,8 +261,7 @@ async def _stream_communicate(process, cell):
262261
except OSError:
263262
pass
264263
except Exception as e:
265-
print("Error while terminating subprocess (pid=%i): %s" \
266-
% (p.pid, e))
264+
print("Error while terminating subprocess (pid=%i): %s" % (p.pid, e))
267265
return
268266
if args.raise_error and p.returncode!=0:
269267
raise CalledProcessError(p.returncode, cell)

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include MANIFEST.in
77
include pytest.ini
88
include mypy.ini
99
include .mailmap
10+
include .flake8
1011

1112
recursive-exclude tools *
1213
exclude tools

0 commit comments

Comments
 (0)