-
Notifications
You must be signed in to change notification settings - Fork 443
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
Fixing dependency generation for jinja templating engine. #2501
Conversation
@@ -112,7 +112,7 @@ def get_string_deps(self, text): | |||
filename = self.lookup.loader.get_source(self.lookup, dep_name)[1] | |||
deps.add(filename) | |||
sub_deps = self.get_deps(filename) | |||
self.dependency_cache[dep_name] = sub_deps | |||
self.dependency_cache[dep_name] = [filename] + sub_deps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is the place? We return deps
from this function, and it’s not taken from the cache. Perhaps add [filename]
a line earlier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, the line deps.add(filename)
can go as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be simpler to just modify sub_deps
right when we define it, wouldn’t it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the current commit, is it what you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks. Approving and merging.
Thanks for merging! |
Jinja template dependencies sometimes miss the main template itself, depending on whether the dependencies where stored in the internal cache in
JinjaTemplates.get_string_deps
or inJinjaTemplates.template_deps
.