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

Update jinja2 and pyzmq, as well as some test/dev dependencies #3493

Merged
merged 2 commits into from
Feb 17, 2020

Conversation

kinow
Copy link
Member

@kinow kinow commented Feb 2, 2020

These changes partially address #2572

Updates jinja2 requirement to 2.11.0 or greater, which effectively means 2.11.1 today, and pyzmq to 18.1.*, which means 18.1.0 today.

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Already covered by existing tests.
  • Appropriate change log entry included.
  • No documentation update required.

@kinow kinow self-assigned this Feb 2, 2020
@kinow kinow added this to the cylc-8.0a2 milestone Feb 2, 2020
@kinow
Copy link
Member Author

kinow commented Feb 2, 2020

pyzmq

pyzmq has fewer changes. A couple related to issues that could affect the WFS or Cylc UI Server (e.g. "handle cancelled futures in asyncio", "fix errors in zmq.Context.destroy() when opening and closing many sockets").

https://pyzmq.readthedocs.io/en/latest/changelog.html#id1

image

@kinow
Copy link
Member Author

kinow commented Feb 2, 2020

jinja2

This version (2.11.0) still supports 2.7, but is the last one. They have released 2.11.1 too, but that version has a single bug for async templates (no idea what's that, but I guess we are not using it).

The 2.11.0 includes several bug fixes, some new features, and also many changes that affect the behaviour of the the Jinja2 API - though it is not clear if the API changed (i.e. not sure if they removed parameters, renamed functions, or anything that would break API binary? backward compatibility).

Some interesting changes:

  • Parentheses around comparisons are preserved, so {{ 2 * (3 < 5) }} outputs “2” instead of “False”.
  • Lexing templates with large amounts of whitespace is much faster.
  • A new jinja2.ext.debug extension adds a {% debug %} tag to quickly dump the current context and available filters and tests.
  • Fix a bug causing deadlocks in LRUCache.setdefault. (:eyes: )
  • Float literals can be written with scientific notation, like 2.56e-3.
  • Int and float literals can be written with the ‘_’ separator for legibility, like 12_345.
  • Fix behavior of loop control variables such as length and revindex0 when looping over a generator.
  • Tracebacks for exceptions in templates show the correct line numbers and source for Python >= 3.7. (@hjoliver I suspect it requires something from Py 3.7, so I will check if that works with Cylc 7 and Py27 too before raising the second PR)

https://jinja.palletsprojects.com/en/2.11.x/changelog/#version-2-11-0

image

@@ -46,19 +46,19 @@ def find_version(*file_paths):
'colorama==0.4.*',
'graphene>=2.1,<3',
'metomi-isodatetime==1!2.0.*',
'jinja2>=2.10.1, <2.11.0',
'jinja2==2.11.*',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, this could be

  • jinja2>=2.10.1, <2.12.0 (so users could still use 2.10.1 if they prefer?)
  • jinja2~=2.11.1 (gives users 2.11.0, or anything after that)

@kinow
Copy link
Member Author

kinow commented Feb 2, 2020

Build passed. Marking as ready for review. Will add another commit with the change log (which means a new build in Travis, but the previous one can be seen here)

@kinow kinow marked this pull request as ready for review February 2, 2020 22:22
@kinow kinow requested a review from hjoliver February 2, 2020 23:30
@kinow kinow mentioned this pull request Feb 16, 2020
6 tasks
CHANGES.md Outdated Show resolved Hide resolved
@oliver-sanders
Copy link
Member

@cylc/core - Jinja2 update - Watch out for any unexpected behaviour changes in workflows.
@TomekTrzeciak - Heads up!

@hjoliver
Copy link
Member

Watch out for any unexpected behaviour changes in workflows.

I guess from the Cylc perspective, we support use of Jinja2 in workflow definitions, but it is not up to us to guarantee back-compatibility across Jinja2 releases. Best we can do is warn to watch out!

@hjoliver hjoliver merged commit 6b769ca into cylc:master Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants