Skip to content

Commit 2624942

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 321c00e commit 2624942

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pydra/engine/audit.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def audit_check(self, flag):
171171

172172
def audit_task(self, task):
173173
import subprocess as sp
174+
174175
label = task.name
175176
if hasattr(task.inputs, "executable"):
176177
command = task.cmdline
@@ -186,7 +187,9 @@ def audit_task(self, task):
186187
software = command.split()[0]
187188
software = software + " " + "--version"
188189
# take the first word of command as the name of the executable (this may not always be the case)
189-
version_cmd = (sp.run(software, shell=True, stdout=sp.PIPE).stdout.decode("utf-8"))
190+
version_cmd = sp.run(software, shell=True, stdout=sp.PIPE).stdout.decode(
191+
"utf-8"
192+
)
190193
try:
191194
version_cmd = version_cmd.splitlines()[0]
192195

@@ -203,7 +206,7 @@ def audit_task(self, task):
203206
"Command": command,
204207
"StartedAtTime": now(),
205208
# "Used": input_file,
206-
"AssociatedWith": version_cmd
209+
"AssociatedWith": version_cmd,
207210
}
208211

209212
# new code to be added here for i/o tracking - WIP

pydra/engine/tests/test_task.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,6 @@ def test_audit_shellcommandtask(tmpdir):
10431043
assert any(label_content)
10441044

10451045

1046-
1047-
10481046
def test_audit_shellcommandtask_version(tmpdir):
10491047
cmd = "mrcat"
10501048
shelly = ShellCommandTask(
@@ -1056,6 +1054,7 @@ def test_audit_shellcommandtask_version(tmpdir):
10561054

10571055
import subprocess as sp
10581056
import glob
1057+
10591058
shelly.cache_dir = tmpdir
10601059
shelly()
10611060
message_path = tmpdir / shelly.checksum / "messages"
@@ -1068,7 +1067,6 @@ def test_audit_shellcommandtask_version(tmpdir):
10681067
if "== mrcat 3.0.3 ==" in data["AssociatedWith"]:
10691068
version_content.append(True)
10701069

1071-
10721070
assert any(version_content)
10731071

10741072

0 commit comments

Comments
 (0)