Skip to content

Commit c1d689e

Browse files
[pre-commit.ci] pre-commit autoupdate (#1295)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <[email protected]>
1 parent 2563bae commit c1d689e

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
- id: trailing-whitespace
2121

2222
- repo: https://github.com/python-jsonschema/check-jsonschema
23-
rev: 0.23.1
23+
rev: 0.23.2
2424
hooks:
2525
- id: check-github-workflows
2626

@@ -34,8 +34,8 @@ repos:
3434
hooks:
3535
- id: black
3636

37-
- repo: https://github.com/charliermarsh/ruff-pre-commit
38-
rev: v0.0.270
37+
- repo: https://github.com/astral-sh/ruff-pre-commit
38+
rev: v0.0.276
3939
hooks:
4040
- id: ruff
4141
args: ["--fix"]

jupyter_server/gateway/gateway_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ async def _fetch(self, endpoint: str, **kwargs: ty.Any) -> HTTPResponse:
734734
raise e
735735
logging.getLogger("ServerApp").info(
736736
f"Attempting retry ({self.retry_count}) against "
737-
f"endpoint '{endpoint}'. Retried error: '{repr(e)}'"
737+
f"endpoint '{endpoint}'. Retried error: '{e!r}'"
738738
)
739739
response = await self._fetch(endpoint, **kwargs)
740740
return response

jupyter_server/serverapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ def _default_allow_remote(self):
12291229

12301230
# if blank, self.ip was configured to "*" meaning bind to all interfaces,
12311231
# see _valdate_ip
1232-
if self.ip == "": # noqa
1232+
if self.ip == "":
12331233
return True
12341234

12351235
try:

jupyter_server/services/kernels/connection/channels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def write_stderr(self, error_message, parent_header):
644644
err_msg["channel"] = "iopub"
645645
self.write_message(json.dumps(err_msg, default=json_default))
646646

647-
def _limit_rate(self, channel, msg, msg_list): # noqa
647+
def _limit_rate(self, channel, msg, msg_list):
648648
"""Limit the message rate on a channel."""
649649
if not (self.limit_rate and channel == "iopub"):
650650
return False

jupyter_server/services/kernels/websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def select_subprotocol(self, subprotocols):
8787
preferred_protocol = self.connection.kernel_ws_protocol
8888
if preferred_protocol is None:
8989
preferred_protocol = "v1.kernel.websocket.jupyter.org"
90-
elif preferred_protocol == "": # noqa
90+
elif preferred_protocol == "":
9191
preferred_protocol = None
9292
selected_subprotocol = preferred_protocol if preferred_protocol in subprotocols else None
9393
# None is the default, "legacy" protocol

jupyter_server/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def path2url(path):
5757
"""Convert a local file path to a URL"""
5858
pieces = [quote(p) for p in path.split(os.sep)]
5959
# preserve trailing /
60-
if pieces[-1] == "": # noqa
60+
if pieces[-1] == "":
6161
pieces[-1] = "/"
6262
url = url_path_join(*pieces)
6363
return url
@@ -121,7 +121,7 @@ def to_os_path(path: ApiPath, root: str = "") -> str:
121121
root must be a filesystem path already.
122122
"""
123123
parts = str(path).strip("/").split("/")
124-
parts = [p for p in parts if p != ""] # noqa # remove duplicate splits
124+
parts = [p for p in parts if p != ""] # remove duplicate splits
125125
path_ = os.path.join(root, *parts)
126126
return os.path.normpath(path_)
127127

@@ -135,7 +135,7 @@ def to_api_path(os_path: str, root: str = "") -> ApiPath:
135135
if os_path.startswith(root):
136136
os_path = os_path[len(root) :]
137137
parts = os_path.strip(os.path.sep).split(os.path.sep)
138-
parts = [p for p in parts if p != ""] # noqa # remove duplicate splits
138+
parts = [p for p in parts if p != ""] # remove duplicate splits
139139
path = "/".join(parts)
140140
return ApiPath(path)
141141

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ detached = true
121121
dependencies = [
122122
"black[jupyter]==23.3.0",
123123
"mdformat>0.7",
124-
"ruff==0.0.270",
124+
"ruff==0.0.276",
125125
]
126126
[tool.hatch.envs.lint.scripts]
127127
style = [
@@ -222,6 +222,8 @@ ignore = [
222222
"PLR0913",
223223
# PLR0912 Too many branches
224224
"PLR0912",
225+
# RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
226+
"RUF012",
225227
]
226228
unfixable = [
227229
# Don't touch print statements

0 commit comments

Comments
 (0)