Skip to content

Commit 8e020fb

Browse files
committed
Separate the notion of requirements and hints
1 parent 1b56338 commit 8e020fb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cwltool/command_line_tool.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -881,11 +881,15 @@ def remove_prefix(s: str, prefix: str) -> str:
881881
"ShellCommandRequirement",
882882
"NetworkAccess",
883883
}
884-
for rh in (self.original_requirements, self.original_hints):
885-
for r in reversed(rh):
886-
cls = cast(str, r["class"])
887-
if cls in interesting and cls not in keydict:
888-
keydict[cls] = r
884+
885+
for r in self.original_requirements:
886+
cls = cast(str, r["class"])
887+
if cls in interesting and cls not in keydict:
888+
keydict.setdefault("requirements", {})[cls] = r
889+
for h in self.original_hints:
890+
cls = cast(str, h["class"])
891+
if cls in interesting and cls not in keydict:
892+
keydict.setdefault("hints",{})[cls] = h
889893

890894
keydictstr = json_dumps(keydict, separators=(",", ":"), sort_keys=True)
891895
cachekey = hashlib.md5(keydictstr.encode("utf-8")).hexdigest() # nosec

0 commit comments

Comments
 (0)