diff --git a/CHANGES.md b/CHANGES.md index 4953d22e377..301c0fbf75b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -35,6 +35,9 @@ Third Release Candidate for Cylc 8 suitable for acceptance testing. ### Enhancements +[#4842](https://github.com/cylc/cylc-flow/pull/4842) - +Improve Jinja2 error reporting when the error is behind an `{% include`. + [#4828](https://github.com/cylc/cylc-flow/pull/4828) - scan CLI: corrupt workflow contact files should result in a warning, not a crash. diff --git a/cylc/flow/parsec/empysupport.py b/cylc/flow/parsec/empysupport.py index 8e57cda23ad..4007b088df7 100644 --- a/cylc/flow/parsec/empysupport.py +++ b/cylc/flow/parsec/empysupport.py @@ -21,12 +21,30 @@ from io import StringIO import em import os +import typing as t from cylc.flow.parsec.exceptions import EmPyError -def empyprocess(flines, dir_, template_vars=None): - """Pass configure file through EmPy processor.""" +def empyprocess( + _fpath: str, + flines: t.List[str], + dir_: str, + template_vars: t.Dict[str, t.Any] = None, +) -> t.List[str]: + """Pass configure file through EmPy processor. + + Args: + _fpath: + The path to the root template file (i.e. the flow.cylc file) + flines: + List of template lines to process. + dir_: + The path to the configuration directory. + template_vars: + Dictionary of template variables. + + """ cwd = os.getcwd() @@ -38,7 +56,10 @@ def empyprocess(flines, dir_, template_vars=None): interpreter.file(ftempl, '