From 83785848151ef1f9d7e5bd704507b6b5a5b1884f Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 9 Sep 2023 04:21:53 -0500 Subject: [PATCH] apply fixes --- .github/workflows/ci.yml | 4 ++-- examples/embedding/inprocess_qtconsole.py | 2 +- examples/embedding/inprocess_terminal.py | 2 +- ipykernel/debugger.py | 4 ++-- ipykernel/inprocess/channels.py | 2 +- ipykernel/iostream.py | 4 ++-- ipykernel/ipkernel.py | 2 +- ipykernel/kernelapp.py | 2 +- ipykernel/tests/test_eventloop.py | 2 +- ipykernel/tests/test_message_spec.py | 2 +- ipykernel/tests/test_start_kernel.py | 4 ++-- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9701cdf81..8187aa0d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,8 +81,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Run Linters - run: | + - name: Run Linters + run: | hatch run typing:test hatch run lint:style pipx run interrogate -vv . diff --git a/examples/embedding/inprocess_qtconsole.py b/examples/embedding/inprocess_qtconsole.py index c346a97fb..18ce28638 100644 --- a/examples/embedding/inprocess_qtconsole.py +++ b/examples/embedding/inprocess_qtconsole.py @@ -19,7 +19,7 @@ def init_asyncio_patch(): asyncio implementation on Windows Pick the older SelectorEventLoopPolicy on Windows if the known-incompatible default policy is in use. - do this as early as possible to make it a low priority and overrideable + do this as early as possible to make it a low priority and overridable ref: https://github.com/tornadoweb/tornado/issues/2608 FIXME: if/when tornado supports the defaults in asyncio, remove and bump tornado requirement for py38 diff --git a/examples/embedding/inprocess_terminal.py b/examples/embedding/inprocess_terminal.py index 79e11e03a..b644c94af 100644 --- a/examples/embedding/inprocess_terminal.py +++ b/examples/embedding/inprocess_terminal.py @@ -19,7 +19,7 @@ def init_asyncio_patch(): asyncio implementation on Windows Pick the older SelectorEventLoopPolicy on Windows if the known-incompatible default policy is in use. - do this as early as possible to make it a low priority and overrideable + do this as early as possible to make it a low priority and overridable ref: https://github.com/tornadoweb/tornado/issues/2608 FIXME: if/when tornado supports the defaults in asyncio, remove and bump tornado requirement for py38 diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py index 1c9b94395..90e4f8885 100644 --- a/ipykernel/debugger.py +++ b/ipykernel/debugger.py @@ -40,7 +40,7 @@ raise e -# Required for backwards compatiblity +# Required for backwards compatibility ROUTING_ID = getattr(zmq, "ROUTING_ID", None) or zmq.IDENTITY @@ -644,7 +644,7 @@ async def richInspectVariables(self, message): repr_data = {} repr_metadata = {} if not self.stopped_threads: - # The code did not hit a breakpoint, we use the intepreter + # The code did not hit a breakpoint, we use the interpreter # to get the rich representation of the variable result = get_ipython().user_expressions({var_name: var_name})[var_name] if result.get("status", "error") == "ok": diff --git a/ipykernel/inprocess/channels.py b/ipykernel/inprocess/channels.py index 964015ed3..d3f03fcfd 100644 --- a/ipykernel/inprocess/channels.py +++ b/ipykernel/inprocess/channels.py @@ -18,7 +18,7 @@ class InProcessChannel: proxy_methods: List[object] = [] def __init__(self, client=None): - """Initialze the channel.""" + """Initialize the channel.""" super().__init__() self.client = client self._is_alive = False diff --git a/ipykernel/iostream.py b/ipykernel/iostream.py index 87834e26b..40e3cc07d 100644 --- a/ipykernel/iostream.py +++ b/ipykernel/iostream.py @@ -373,7 +373,7 @@ def fileno(self): def _watch_pipe_fd(self): """ - We've redirected standards steams 0 and 1 into a pipe. + We've redirected standards streams 0 and 1 into a pipe. We need to watch in a thread and redirect them to the right places. @@ -424,7 +424,7 @@ def __init__( that will swap the give file descriptor for a pipe, read from the pipe, and insert this into the current Stream. isatty : bool (default, False) - Indication of whether this stream has termimal capabilities (e.g. can handle colors) + Indication of whether this stream has terminal capabilities (e.g. can handle colors) """ if pipe is not None: diff --git a/ipykernel/ipkernel.py b/ipykernel/ipkernel.py index c1c79e942..bc79d5922 100644 --- a/ipykernel/ipkernel.py +++ b/ipykernel/ipkernel.py @@ -328,7 +328,7 @@ def set_sigint_result(): # use add_callback for thread safety self.io_loop.add_callback(set_sigint_result) - # set the custom sigint hander during this context + # set the custom sigint handler during this context save_sigint = signal.signal(signal.SIGINT, handle_sigint) try: yield diff --git a/ipykernel/kernelapp.py b/ipykernel/kernelapp.py index da6d19656..23bd477e7 100644 --- a/ipykernel/kernelapp.py +++ b/ipykernel/kernelapp.py @@ -634,7 +634,7 @@ def _init_asyncio_patch(self): but it is still preferable to run the Selector in the main thread instead of the background. - do this as early as possible to make it a low priority and overrideable + do this as early as possible to make it a low priority and overridable ref: https://github.com/tornadoweb/tornado/issues/2608 diff --git a/ipykernel/tests/test_eventloop.py b/ipykernel/tests/test_eventloop.py index a4d18d114..119ba84d5 100644 --- a/ipykernel/tests/test_eventloop.py +++ b/ipykernel/tests/test_eventloop.py @@ -144,7 +144,7 @@ def test_qt_enable_gui(kernel, capsys): enable_gui(gui, kernel) assert app == kernel.app - # Event loop intergration can be turned off. + # Event loop integration can be turned off. enable_gui(None, kernel) assert not hasattr(kernel, 'app') diff --git a/ipykernel/tests/test_message_spec.py b/ipykernel/tests/test_message_spec.py index 5710cf297..5723703c2 100644 --- a/ipykernel/tests/test_message_spec.py +++ b/ipykernel/tests/test_message_spec.py @@ -469,7 +469,7 @@ def test_oinfo_detail(): def test_oinfo_not_found(): flush_channels() - msg_id = KC.inspect("dne") + msg_id = KC.inspect("does_not_exist") reply = get_reply(KC, msg_id, TIMEOUT) validate_message(reply, "inspect_reply", msg_id) content = reply["content"] diff --git a/ipykernel/tests/test_start_kernel.py b/ipykernel/tests/test_start_kernel.py index b2b2d3b8c..f2a632be0 100644 --- a/ipykernel/tests/test_start_kernel.py +++ b/ipykernel/tests/test_start_kernel.py @@ -17,13 +17,13 @@ def test_ipython_start_kernel_userns(): cmd = dedent( """ from ipykernel.kernelapp import launch_new_instance - ns = {"tre": 123} + ns = {"custom": 123} launch_new_instance(user_ns=ns) """ ) with setup_kernel(cmd) as client: - client.inspect("tre") + client.inspect("custom") msg = client.get_shell_msg(timeout=TIMEOUT) content = msg["content"] assert content["found"]