You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Jinja2 filters are not in the root of the extensions directory, grow fails to import them on the translation extract process. I've attached a reproduction case. Grow run and build work as expected, this only happens with grow translations extract --localized.
This is the error I get:
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/bin/grow", line 33, in <module>
sys.exit(load_entry_point('grow', 'console_scripts', 'grow')())
File "/home/code/grow/grow/cli.py", line 21, in main
group.grow.main(args=args, prog_name=name)
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/code/grow/grow/commands/subcommands/translations_extract.py", line 62, in translations_extract
catalogs.extract(include_obsolete=include_obsolete, localized=localized,
File "/home/code/grow/grow/translations/catalog_holder.py", line 460, in extract
_babel_extract(f, self.pod.list_locales(), pod_path)
File "/home/code/grow/grow/translations/catalog_holder.py", line 298, in _babel_extract
for parts in all_parts:
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/babel/messages/extract.py", line 325, in extract
for lineno, funcname, messages, comments in results:
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/jinja2/ext.py", line 652, in babel_extract
extensions.add(import_string(extension))
File "/home/.local/share/virtualenvs/extract-bug-vbXN9orH/lib/python3.8/site-packages/jinja2/utils.py", line 131, in import_string
return getattr(__import__(module, None, None, [obj]), obj)
ModuleNotFoundError: No module named 'filters'
This happens on grow 1+ and grow 2+. It doesn't happen on 0.x.
Hi Luis - thanks for sending the test case. I played with the test case a bit and found that if you move files from /ext/utils/ to just /ext/ things will work correctly. I will follow up here if there's something further that can be done either within the test case or within Grow to resolve things.
When Jinja2 filters are not in the root of the extensions directory, grow fails to import them on the translation extract process. I've attached a reproduction case. Grow run and build work as expected, this only happens with
grow translations extract --localized
.This is the error I get:
This happens on grow 1+ and grow 2+. It doesn't happen on 0.x.
reproduction-case.zip
The text was updated successfully, but these errors were encountered: