-
Notifications
You must be signed in to change notification settings - Fork 94
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
Jinja2 enhancements #2733
Jinja2 enhancements #2733
Conversation
This definitely sounds useful, no objections from me. A couple of examples would be good, so I don't need to work it out (short of time!) - presumably your CUG documentation will add that. |
Some test failures here. Should be easy enough to fix. |
(Regarding my request for an example - specifically "loading Python modules in Jinja2 templates"; the other bits are reasonably obvious to me). |
9b71608
to
cdf6c3f
Compare
Added docs and rebased. @hjoliver, for an example see the new section "Importing additional Python modules" in the docs. |
eb1e26d
to
4b8c3f8
Compare
Codacy is hard to please, but it may have a point. Do you think this one is easy to solve? |
@matthewrmshin, in this case it's impossible to please codacy. It gives me "Parameters differ from overridden 'load' method", but the parameter in question is named |
I believe this PR is ready for review now. |
e286278
to
f387cdb
Compare
Codacy drives me nuts 😡 I've fixed the complaints but this triggered hotspot detection due to frequent changes. Agrhhh... |
Codacy is useful, but yeah, it can be maddening. We don't require a complete "pass" when it's obviously full of 💩 |
(Agree that we should just ignore Codacy for this change.) |
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.
Looks good to me; nicely documented; python module import will be super useful. (One trivial spelling error).
Fix the typo and codacy seems to be happy this time around 😁 |
@TomekTrzeciak - the user guide changes here now conflict slightly with your EmPy support (just merged). Should be easy to resolve by accepting both changes and checking placement, I expect. |
(Branch in small conflict.) |
Fixed, should merge cleanly now. |
The future plan is to have proper API for Cylc, but this future is still quite far away. In the meantime, we could have some improvements to make the templating experience better. This PR adds two such improvements:
select
/reject
filters, which use thetests
namespace.zip
equivalent, which makes some basic programming tasks quite awkward. Rather than keep adding useful bits of functionality one-by-one, it is left up to the user to decide which packages are of the most use.TODO: