From 09c9b2ad9c15202c5d1896ba24ec978b726c073b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:28:22 -0600 Subject: [PATCH] chore: update pre-commit hooks (#1205) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester --- .pre-commit-config.yaml | 6 +++--- ipykernel/debugger.py | 4 ++-- ipykernel/kernelapp.py | 2 +- ipykernel/pickleutil.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a464ba48..cc2cfd9d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.3 + rev: 0.27.4 hooks: - id: check-github-workflows @@ -74,7 +74,7 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.2.0 hooks: - id: ruff types_or: [python, jupyter] @@ -83,7 +83,7 @@ repos: types_or: [python, jupyter] - repo: https://github.com/scientific-python/cookie - rev: "2023.12.21" + rev: "2024.01.24" hooks: - id: sp-repo-review additional_dependencies: ["repo-review[cli]"] diff --git a/ipykernel/debugger.py b/ipykernel/debugger.py index 138b7726..657cc80c 100644 --- a/ipykernel/debugger.py +++ b/ipykernel/debugger.py @@ -473,7 +473,7 @@ async def setBreakpoints(self, message): message_response = await self._forward_message(message) # debugpy can set breakpoints on different lines than the ones requested, # so we want to record the breakpoints that were actually added - if "success" in message_response and message_response["success"]: + if message_response.get("success"): self.breakpoint_list[source] = [ {"line": breakpoint["line"]} for breakpoint in message_response["body"]["breakpoints"] @@ -661,7 +661,7 @@ async def richInspectVariables(self, message): } ) if reply["success"]: - repr_data, repr_metadata = eval(reply["body"]["result"], {}, {}) # noqa: PGH001 + repr_data, repr_metadata = eval(reply["body"]["result"], {}, {}) body = { "data": repr_data, diff --git a/ipykernel/kernelapp.py b/ipykernel/kernelapp.py index 9cfb55a5..097b65aa 100644 --- a/ipykernel/kernelapp.py +++ b/ipykernel/kernelapp.py @@ -675,7 +675,7 @@ def init_pdb(self): # Only available in newer IPython releases: debugger.Pdb = debugger.InterruptiblePdb # type:ignore[misc] pdb.Pdb = debugger.Pdb # type:ignore[assignment,misc] - pdb.set_trace = debugger.set_trace # type:ignore[assignment] + pdb.set_trace = debugger.set_trace @catch_config_error def initialize(self, argv=None): diff --git a/ipykernel/pickleutil.py b/ipykernel/pickleutil.py index 3cfb74a5..a52115da 100644 --- a/ipykernel/pickleutil.py +++ b/ipykernel/pickleutil.py @@ -179,7 +179,7 @@ def get_object(self, g=None): if g is None: g = {} - return eval(self.name, g) # noqa: PGH001 + return eval(self.name, g) class CannedCell(CannedObject):