Show More
@@ -26,20 +26,9 b' jobs:' | |||||
26 | pip install mypy pyflakes flake8 |
|
26 | pip install mypy pyflakes flake8 | |
27 | - name: Lint with mypy |
|
27 | - name: Lint with mypy | |
28 | run: | |
|
28 | run: | | |
29 |
mypy IPython |
|
29 | mypy -p IPython.terminal | |
30 |
mypy IPython |
|
30 | mypy -p IPython.core.magics | |
31 | mypy IPython/terminal/__init__.py |
|
|||
32 | mypy IPython/terminal/console.py |
|
|||
33 | #mypy IPython/terminal/debugger.py |
|
|||
34 | #mypy IPython/terminal/embed.py |
|
|||
35 | mypy IPython/terminal/interactiveshell.py |
|
|||
36 | mypy IPython/terminal/ipapp.py |
|
|||
37 | mypy IPython/terminal/magics.py |
|
|||
38 | mypy IPython/terminal/prompts.py |
|
|||
39 | mypy IPython/terminal/ptshell.py |
|
|||
40 | mypy IPython/terminal/ptutils.py |
|
|||
41 | mypy IPython/terminal/shortcuts.py |
|
|||
42 | mypy IPython/core/c*.py |
|
|||
43 | - name: Lint with pyflakes |
|
31 | - name: Lint with pyflakes | |
44 | run: | |
|
32 | run: | | |
45 | flake8 IPython/core/magics/script.py |
|
33 | flake8 IPython/core/magics/script.py | |
|
34 | flake8 IPython/core/magics/packaging.py |
@@ -161,6 +161,6 b" if __name__ == '__main__':" | |||||
161 | # happened after hitting "c", this is needed in order to |
|
161 | # happened after hitting "c", this is needed in order to | |
162 | # be able to quit the debugging session (see #9950). |
|
162 | # be able to quit the debugging session (see #9950). | |
163 | old_trace_dispatch = pdb.Pdb.trace_dispatch |
|
163 | old_trace_dispatch = pdb.Pdb.trace_dispatch | |
164 | pdb.Pdb = TerminalPdb |
|
164 | pdb.Pdb = TerminalPdb # type: ignore | |
165 | pdb.Pdb.trace_dispatch = old_trace_dispatch |
|
165 | pdb.Pdb.trace_dispatch = old_trace_dispatch # type: ignore | |
166 | pdb.main() |
|
166 | pdb.main() |
@@ -19,6 +19,8 b' from IPython.terminal.ipapp import load_default_config' | |||||
19 | from traitlets import Bool, CBool, Unicode |
|
19 | from traitlets import Bool, CBool, Unicode | |
20 | from IPython.utils.io import ask_yes_no |
|
20 | from IPython.utils.io import ask_yes_no | |
21 |
|
21 | |||
|
22 | from typing import Set | |||
|
23 | ||||
22 | class KillEmbedded(Exception):pass |
|
24 | class KillEmbedded(Exception):pass | |
23 |
|
25 | |||
24 | # kept for backward compatibility as IPython 6 was released with |
|
26 | # kept for backward compatibility as IPython 6 was released with | |
@@ -123,17 +125,17 b' class InteractiveShellEmbed(TerminalInteractiveShell):' | |||||
123 | help="Automatically set the terminal title" |
|
125 | help="Automatically set the terminal title" | |
124 | ).tag(config=True) |
|
126 | ).tag(config=True) | |
125 |
|
127 | |||
126 | _inactive_locations = set() |
|
128 | _inactive_locations: Set[str] = set() | |
|
129 | ||||
|
130 | def _disable_init_location(self): | |||
|
131 | """Disable the current Instance creation location""" | |||
|
132 | InteractiveShellEmbed._inactive_locations.add(self._init_location_id) | |||
127 |
|
133 | |||
128 | @property |
|
134 | @property | |
129 | def embedded_active(self): |
|
135 | def embedded_active(self): | |
130 | return (self._call_location_id not in InteractiveShellEmbed._inactive_locations)\ |
|
136 | return (self._call_location_id not in InteractiveShellEmbed._inactive_locations)\ | |
131 | and (self._init_location_id not in InteractiveShellEmbed._inactive_locations) |
|
137 | and (self._init_location_id not in InteractiveShellEmbed._inactive_locations) | |
132 |
|
138 | |||
133 | def _disable_init_location(self): |
|
|||
134 | """Disable the current Instance creation location""" |
|
|||
135 | InteractiveShellEmbed._inactive_locations.add(self._init_location_id) |
|
|||
136 |
|
||||
137 | @embedded_active.setter |
|
139 | @embedded_active.setter | |
138 | def embedded_active(self, value): |
|
140 | def embedded_active(self, value): | |
139 | if value: |
|
141 | if value: |
@@ -9,7 +9,7 b' import ctypes' | |||||
9 | import ctypes.util |
|
9 | import ctypes.util | |
10 | from threading import Event |
|
10 | from threading import Event | |
11 |
|
11 | |||
12 |
objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library( |
|
12 | objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("objc")) # type: ignore | |
13 |
|
13 | |||
14 | void_p = ctypes.c_void_p |
|
14 | void_p = ctypes.c_void_p | |
15 |
|
15 | |||
@@ -37,7 +37,7 b' def C(classname):' | |||||
37 | # end obj-c boilerplate from appnope |
|
37 | # end obj-c boilerplate from appnope | |
38 |
|
38 | |||
39 | # CoreFoundation C-API calls we will use: |
|
39 | # CoreFoundation C-API calls we will use: | |
40 |
CoreFoundation = ctypes.cdll.LoadLibrary(ctypes.util.find_library( |
|
40 | CoreFoundation = ctypes.cdll.LoadLibrary(ctypes.util.find_library("CoreFoundation")) # type: ignore | |
41 |
|
41 | |||
42 | CFFileDescriptorCreate = CoreFoundation.CFFileDescriptorCreate |
|
42 | CFFileDescriptorCreate = CoreFoundation.CFFileDescriptorCreate | |
43 | CFFileDescriptorCreate.restype = void_p |
|
43 | CFFileDescriptorCreate.restype = void_p |
General Comments 0
You need to be logged in to leave comments.
Login now