Skip to content

Commit 84c3bbd

Browse files
authored
Upgrade black to 24.3.0 (#3618)
Recommended by dependabot due to a CVE (which doesn't really affect us). On the whole, the changes caused by this new version seem trivial and innocuous (like adding blank lines after file docstrings) or minor improvements in readability (the new wrapping of compound dict references and broken ternary expressions). This supercedes dependabot's #3453.
1 parent c695339 commit 84c3bbd

36 files changed

+60
-29
lines changed

contrib/analysis/sos_collection.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ def sync_process_sos(self, combined_data: dict):
333333
else:
334334
self.seen_sos_valid[sosreport] = extracted_sos_data
335335
else:
336-
combined_data["sosreports"][sosreport][
337-
"extracted_sos"
338-
] = self.seen_sos_invalid[sosreport]
336+
combined_data["sosreports"][sosreport]["extracted_sos"] = (
337+
self.seen_sos_invalid[sosreport]
338+
)
339339
else:
340-
combined_data["sosreports"][sosreport][
341-
"extracted_sos"
342-
] = self.seen_sos_valid[sosreport]
340+
combined_data["sosreports"][sosreport]["extracted_sos"] = (
341+
self.seen_sos_valid[sosreport]
342+
)

lib/pbench/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, cfg_name):
3232
try:
3333
self.logger_host = self._conf.get("logging", "logger_host")
3434
self.logger_port = self._conf.get("logging", "logger_port")
35-
except (NoOptionError) as exc:
35+
except NoOptionError as exc:
3636
raise BadConfig(str(exc))
3737

3838
try:

lib/pbench/agent/redis_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Redis Convenience classes
22
"""
3+
34
import json
45
import logging
56
import time

lib/pbench/agent/tool_meister.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,9 +1779,7 @@ def sysinfo(self, data: Dict[str, str]) -> int:
17791779
self._send_client_status(
17801780
"success"
17811781
if failures == 0
1782-
else f"{failures} failures sending sysinfo data"
1783-
if not msg
1784-
else msg
1782+
else f"{failures} failures sending sysinfo data" if not msg else msg
17851783
)
17861784

17871785
return failures

lib/pbench/agent/tool_meister_start.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,9 +1105,11 @@ def start(_prog: str, cli_params: Namespace) -> int:
11051105
tm = dict(
11061106
benchmark_run_dir=str(benchmark_run_dir),
11071107
channel_prefix=cli_tm_channel_prefix,
1108-
tds_hostname=params["origin_host"]
1109-
if "origin_host" in params
1110-
else tool_data_sink.host,
1108+
tds_hostname=(
1109+
params["origin_host"]
1110+
if "origin_host" in params
1111+
else tool_data_sink.host
1112+
),
11111113
tds_port=tool_data_sink.port,
11121114
controller=full_hostname,
11131115
tool_group=tool_group.name,

lib/pbench/agent/toolmetadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
Classes for working with and manipulating the tool-scripts/meta.json file.
44
"""
5+
56
import json
67

78

lib/pbench/cli/agent/commands/results/clear.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
pbench-clear-results
33
"""
4+
45
import shutil
56
import sys
67

lib/pbench/cli/agent/commands/triggers/list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
triggers from a specific group.
66
77
"""
8+
89
import sys
910

1011
import click

lib/pbench/cli/agent/commands/triggers/register.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
directory.
1111
1212
"""
13+
1314
import logging
1415
import sys
1516

lib/pbench/common/configtools.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" Configtools """
2+
23
from __future__ import print_function
34

45
# python3
@@ -34,9 +35,11 @@ def file_list(root):
3435
rootdir = os.path.dirname(root)
3536
flist = [root]
3637
dirlist = [
37-
os.path.abspath("%s/%s" % (rootdir, x))
38-
if not os.path.isabs(x)
39-
else os.path.abspath(x)
38+
(
39+
os.path.abspath("%s/%s" % (rootdir, x))
40+
if not os.path.isabs(x)
41+
else os.path.abspath(x)
42+
)
4043
for x in dirlist
4144
]
4245
# insert the directory of the root file at the beginning
@@ -221,7 +224,7 @@ def main(conf, args, opts, files):
221224
print("[%s]" % sec)
222225
items = conf.items(sec)
223226
items.sort()
224-
for (n, v) in items:
227+
for n, v in items:
225228
print("%s = %s" % (n, v))
226229
print()
227230
return 0

0 commit comments

Comments
 (0)