Skip to content

Separate requirements and hints when caching #2102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,15 @@
"ShellCommandRequirement",
"NetworkAccess",
}
for rh in (self.original_requirements, self.original_hints):
for r in reversed(rh):
cls = cast(str, r["class"])
if cls in interesting and cls not in keydict:
keydict[cls] = r

for r in self.original_requirements:
cls = cast(str, r["class"])

Check warning on line 886 in cwltool/command_line_tool.py

View check run for this annotation

Codecov / codecov/patch

cwltool/command_line_tool.py#L886

Added line #L886 was not covered by tests
if cls in interesting and cls not in keydict:
keydict.setdefault("requirements", {})[cls] = r

Check warning on line 888 in cwltool/command_line_tool.py

View check run for this annotation

Codecov / codecov/patch

cwltool/command_line_tool.py#L888

Added line #L888 was not covered by tests
for h in self.original_hints:
cls = cast(str, h["class"])
if cls in interesting and cls not in keydict:
keydict.setdefault("hints",{})[cls] = h

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