Skip to content

Commit 0a48a93

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8c9f931 commit 0a48a93

File tree

6 files changed

+53
-54
lines changed

6 files changed

+53
-54
lines changed

CHANGELOG.md

Lines changed: 45 additions & 45 deletions
Large diffs are not rendered by default.

jupyter_server/kernelspecs/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def get(self, kernel_name, path, include_body=True):
2929
"""Get a kernelspec resource."""
3030
ksm = self.kernel_spec_manager
3131
if path.lower().endswith(".png"):
32-
self.set_header("Cache-Control", f"max-age={60*60*24*30}")
32+
self.set_header("Cache-Control", f"max-age={60 * 60 * 24 * 30}")
3333
ksm = self.kernel_spec_manager
3434
if hasattr(ksm, "get_kernel_spec_resource"):
3535
# If the kernel spec manager defines a method to get kernelspec resources,

jupyter_server/services/contents/filemanager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ def _copy_dir(self, from_path, to_path_original, to_name, to_path):
667667
"""
668668
try:
669669
os_from_path = self._get_os_path(from_path.strip("/"))
670-
os_to_path = f'{self._get_os_path(to_path_original.strip("/"))}/{to_name}'
670+
os_to_path = f"{self._get_os_path(to_path_original.strip('/'))}/{to_name}"
671671
shutil.copytree(os_from_path, os_to_path)
672672
model = self.get(to_path, content=False)
673673
except OSError as err:
@@ -1150,7 +1150,7 @@ async def _copy_dir(
11501150
"""
11511151
try:
11521152
os_from_path = self._get_os_path(from_path.strip("/"))
1153-
os_to_path = f'{self._get_os_path(to_path_original.strip("/"))}/{to_name}'
1153+
os_to_path = f"{self._get_os_path(to_path_original.strip('/'))}/{to_name}"
11541154
shutil.copytree(os_from_path, os_to_path)
11551155
model = await self.get(to_path, content=False)
11561156
except OSError as err:

jupyter_server/traittypes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ class or its subclasses. Our implementation is quite different
164164
self.klasses = klasses
165165
else:
166166
raise TraitError(
167-
"The klasses attribute must be a list of class names or classes"
168-
" not: %r" % klasses
167+
"The klasses attribute must be a list of class names or classes not: %r" % klasses
169168
)
170169

171170
if (kw is not None) and not isinstance(kw, dict):

tests/services/kernels/test_cull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ async def test_cull_connected(jp_fetch, jp_ws_fetch):
151151
"parent_header": {},
152152
"metadata": {},
153153
"content": {
154-
"code": f"import time\ntime.sleep({CULL_TIMEOUT-1})",
154+
"code": f"import time\ntime.sleep({CULL_TIMEOUT - 1})",
155155
"silent": False,
156156
"allow_stdin": False,
157157
"stop_on_error": True,

tests/test_gateway.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,9 @@ async def test_websocket_connection_with_session_id(init_gateway, jp_serverapp,
753753
expected_ws_url = (
754754
f"{mock_gateway_ws_url}/api/kernels/{kernel_id}/channels?session_id={conn.session_id}"
755755
)
756-
assert (
757-
expected_ws_url in caplog.text
758-
), "WebSocket URL does not contain the expected session_id."
756+
assert expected_ws_url in caplog.text, (
757+
"WebSocket URL does not contain the expected session_id."
758+
)
759759

760760
# Processing websocket messages happens in separate coroutines and any
761761
# errors in that process will show up in logs, but not bubble up to the

0 commit comments

Comments
 (0)