Skip to content

Commit 5f8c1a6

Browse files
[pre-commit.ci] pre-commit autoupdate (#490)
1 parent 1f30332 commit 5f8c1a6

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.6.0
5+
rev: v5.0.0
66
hooks:
77
- id: trailing-whitespace
88
exclude: "^tests/"
@@ -18,7 +18,7 @@ repos:
1818
# Python
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
2020
# Ruff version.
21-
rev: v0.6.2
21+
rev: v0.9.3
2222
hooks:
2323
- id: ruff
2424
args: ["--fix"]
@@ -31,7 +31,7 @@ repos:
3131
args: ["--write"]
3232
# Python inside docs
3333
- repo: https://github.com/asottile/blacken-docs
34-
rev: 1.18.0
34+
rev: 1.19.1
3535
hooks:
3636
- id: blacken-docs
3737
# markdown, yaml

dpdispatcher/contexts/ssh_context.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ def __init__(
449449
self.init_local_root = local_root
450450
self.init_remote_root = remote_root
451451
self.temp_local_root = os.path.abspath(local_root)
452-
assert os.path.isabs(
453-
os.path.realpath(remote_root)
454-
), "remote_root must be a abspath"
452+
assert os.path.isabs(os.path.realpath(remote_root)), (
453+
"remote_root must be a abspath"
454+
)
455455
self.temp_remote_root = remote_root
456456
self.remote_profile = remote_profile
457457
self.remote_root = None

dpdispatcher/machines/JH_UniScheduler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def gen_script_header(self, job):
3939
custom_gpu_line = resources.kwargs.get("custom_gpu_line", None)
4040
if not custom_gpu_line:
4141
script_header_dict["JH_UniScheduler_number_gpu_line"] = (
42-
"" f"#JSUB -gpgpu {resources.gpu_per_node}"
42+
f"#JSUB -gpgpu {resources.gpu_per_node}"
4343
)
4444
else:
4545
script_header_dict["JH_UniScheduler_number_gpu_line"] = custom_gpu_line

dpdispatcher/submission.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,7 @@ async def async_run_submission(self, **kwargs):
323323
kwargs = {**{"clean": False}, **kwargs}
324324
if kwargs["clean"]:
325325
dlog.warning(
326-
"Using async submission with `clean=True`, "
327-
"job may fail in queue system"
326+
"Using async submission with `clean=True`, job may fail in queue system"
328327
)
329328
loop = asyncio.get_event_loop()
330329
wrapped_submission = functools.partial(self.run_submission, **kwargs)

dpdispatcher/utils/hdfs_cli.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def exists(uri):
2828
)
2929
except Exception as e:
3030
raise RuntimeError(
31-
f"Cannot check existence of hdfs uri[{uri}] " f"with cmd[{cmd}]"
31+
f"Cannot check existence of hdfs uri[{uri}] with cmd[{cmd}]"
3232
) from e
3333

3434
@staticmethod
@@ -48,9 +48,7 @@ def remove(uri):
4848
f"with cmd[{cmd}]; ret[{ret}] output[{out}] stderr[{err}]"
4949
)
5050
except Exception as e:
51-
raise RuntimeError(
52-
f"Cannot remove hdfs uri[{uri}] " f"with cmd[{cmd}]"
53-
) from e
51+
raise RuntimeError(f"Cannot remove hdfs uri[{uri}] with cmd[{cmd}]") from e
5452

5553
@staticmethod
5654
def mkdir(uri):
@@ -70,7 +68,7 @@ def mkdir(uri):
7068
)
7169
except Exception as e:
7270
raise RuntimeError(
73-
f"Cannot mkdir of hdfs uri[{uri}] " f"with cmd[{cmd}]"
71+
f"Cannot mkdir of hdfs uri[{uri}] with cmd[{cmd}]"
7472
) from e
7573

7674
@staticmethod
@@ -80,7 +78,7 @@ def copy_from_local(local_path, to_uri):
8078
"""
8179
# Make sure local_path is accessible
8280
if not os.path.exists(local_path) or not os.access(local_path, os.R_OK):
83-
raise RuntimeError(f"try to access local_path[{local_path}] " "but failed")
81+
raise RuntimeError(f"try to access local_path[{local_path}] but failed")
8482
cmd = f"hadoop fs -copyFromLocal -f {local_path} {to_uri}"
8583
try:
8684
ret, out, err = run_cmd_with_all_output(cmd)
@@ -132,9 +130,7 @@ def read_hdfs_file(uri):
132130
f"cmd [{cmd}] ret[{ret}] output[{out}] stderr[{err}]"
133131
)
134132
except Exception as e:
135-
raise RuntimeError(
136-
f"Cannot read text from uri[{uri}]" f"cmd [{cmd}]"
137-
) from e
133+
raise RuntimeError(f"Cannot read text from uri[{uri}]cmd [{cmd}]") from e
138134

139135
@staticmethod
140136
def move(from_uri, to_uri):
@@ -151,6 +147,5 @@ def move(from_uri, to_uri):
151147
)
152148
except Exception as e:
153149
raise RuntimeError(
154-
f"Cannot move from_uri[{from_uri}] to "
155-
f"to_uri[{to_uri}] with cmd[{cmd}]"
150+
f"Cannot move from_uri[{from_uri}] to to_uri[{to_uri}] with cmd[{cmd}]"
156151
) from e

0 commit comments

Comments
 (0)