Skip to content
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

Merged
merged 2 commits into from Sep 19, 2016
Merged

Conversation

@felixfontein
Copy link
Contributor

felixfontein commented Sep 19, 2016

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 in JinjaTemplates.template_deps.

@felixfontein felixfontein added the bug label Sep 19, 2016
@@ -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

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 19, 2016

Member

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?

This comment has been minimized.

Copy link
@felixfontein

felixfontein Sep 19, 2016

Author Contributor

In that case, the line deps.add(filename) can go as well.

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 19, 2016

Member

Would be simpler to just modify sub_deps right when we define it, wouldn’t it?

This comment has been minimized.

Copy link
@felixfontein

felixfontein Sep 19, 2016

Author Contributor

Check the current commit, is it what you want?

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 19, 2016

Member

Perfect, thanks. Approving and merging.

@Kwpolska Kwpolska merged commit fad241e into master Sep 19, 2016
0 of 4 checks passed
0 of 4 checks passed
continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
@Kwpolska Kwpolska deleted the fix-jinja-deps branch Sep 19, 2016
@felixfontein
Copy link
Contributor Author

felixfontein commented Sep 19, 2016

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.