-
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
7.9.x Update to jinja2 2.11.1 #3502
Conversation
@@ -33,7 +33,7 @@ __SUITERC__ | |||
run_fail "${TEST_NAME_BASE}" cylc validate 'suite.rc' | |||
contains_ok "${TEST_NAME_BASE}.stderr" <<'__ERROR__' | |||
Jinja2Error: | |||
'You can only sort by either "key" or "value"' | |||
raise FilterArgumentError('You can only sort by either "key" or "value"') |
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.
The other changes are the result of copy-and-paste of Jinja2 2.11.1 ZIP contents, minus their asyncio files as that breaks the build due to Py3 code.
After copying the files, this was the only test that failed. Debugging it, it looks like the traceback contents changed in 2.11.1, and instead of having just the text on a new line, it contains the raise FilterArgumentError
part too.
Wondering if that's safe to update... I don't think users rely on this?
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.
Seems fine to me.
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.
(What were the asyncio files for though? Is it surprising that deleting those didn't entirely break the new Jinja2?)
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.
Curious, 2.11.1 claims to have 2.7 support. What aspect of the build was breaking? Was is our tests (e.g. pycodestyle) or something functional?
d197dc9
to
4bed434
Compare
@kinow - well done getting this to work with 2.7 @oliver-sanders - this fixes a known bug, but are you particularly concerned about Jinja2 back-compat for Met Office Cylc-7 users? (Given that we bundle Jinja2 with Cylc 7, I'm not sure this statement is as true for Cylc 7 as it is for Cylc 8...) |
Jinja2 bugs in workflows are nasty to debug, worse still as workflows often have highly-branched Jinja2 code bugs go unnoticed until a later date by which time the relation to the change of Cylc version is no longer obvious. So Jinja2 changes need to be well managed and documented to give users a fighting chance. Sneaking a Jinja2 upgrade into a maintenance release would be unhelpful. It would break the trust of our release schedule if maintenance releases have significant interface changes. From a change management perspective |
Second thoughts, from the MO perspective we might still require Python2.6 compatibility for internal release which this would break. Will check. If so we would want to push to this to |
Can do. Is that OK with you @kinow (so your work here won't be wasted 👍 ) (For background, there are many well-known and well-used Cylc-7 suite configs that are essentially massive Jinja2 "programs" 😬 ) |
(OK awaiting comment from @dpmatthews ... from offline chat with @oliver-sanders we could put this PR to 7.9.0, and maintain 7.8.x as well for the few remaining bug fixes...) |
Happy if this is postponed to 7.9 or targeted only for 8.0. Whichever works best. |
I don't think we can remove Python 2.6 compatibility in a 7.8.x release so this would need to become 7.9. We still have Cylc in use on RHEL 6 systems so would have to stick to 7.8. Unless there is demand from others, I suggest we make this an 8.0 change. |
@dpmatthews, legacy RHEL 6 machines are not the only ones that use python 2.6 for running cylc on our site. Just saying... |
Then all users for the next year (ish) will have to live with Jinja2 "incorrect context" bug, which is moderately serious (wrong line numbers are often worse than none, when debugging). So I think putting to 7.9 would be better, for those not stuck on Python 2.6. We don't expect many more changes on 7.x so maintaining two branches for subsequent fixes will be easy enough. |
Fair enough. I assume this pull request will need to be changed to point to a new 7.9.x branch. The installation guide will also need an update to reflect the Python 2.7 requirement. |
@@ -33,7 +33,7 @@ __SUITERC__ | |||
run_fail "${TEST_NAME_BASE}" cylc validate 'suite.rc' | |||
contains_ok "${TEST_NAME_BASE}.stderr" <<'__ERROR__' | |||
Jinja2Error: | |||
'You can only sort by either "key" or "value"' | |||
raise FilterArgumentError('You can only sort by either "key" or "value"') |
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.
Curious, 2.11.1 claims to have 2.7 support. What aspect of the build was breaking? Was is our tests (e.g. pycodestyle) or something functional?
Just this functional test. The output of their traceback changed a bit, so it wasn't matching the output correctly. |
Sorry the context of that comment got skewed. I was referring to the removal of the |
Ah, that one. Travis still has the logs: https://travis-ci.org/kinow/cylc-flow/jobs/645797353 I think it was due to some functional or unit test loading that file? |
@kinow I've created the new 7.9.x branch, so you can re-target this PR. |
4bed434
to
a0b5678
Compare
|
I'll merge this if it passes the functional tests again (it should) ... we've all agreed in principle, and it doesn't change any files outside of |
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.
Tests pass 👍 ; this changes lib/jinja2/
only.
These changes close #2572
Sibling PR of #3493
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.