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

Add upper bound on the Jinja and MarkupSafe dependencies #1740

Open
martinRenou opened this issue Mar 28, 2022 · 2 comments
Open

Add upper bound on the Jinja and MarkupSafe dependencies #1740

martinRenou opened this issue Mar 28, 2022 · 2 comments

Comments

@martinRenou
Copy link
Member

Related #1737

Considering this discussion and the fact that Jinja (and I assume MarkupSafe) do not use semver, we should probably add an upper bound on the Jinja2 and MarkupSafe dependencies. Something like the following could probably be good in order to not get bad surprises?

'jinja2>=2.4,<3.2',
'MarkupSafe>=2.0,<2.2'
@akchinSTC
Copy link

Just piggy backing on this topic, it seems possible ?...
if given an environment with Jinja2<3.0 installed,
...for pip to resolve to using MarkupSafe >= 2.1 when using the latest release of nbconvert. If that happens, I believe there will be an import error here:
https://github.com/pallets/jinja/blob/cf215390d4a4d6f0a4de27e2687eed176878f13d/src/jinja2/filters.py#L13 due to
'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.

@bollwyvl
Copy link
Contributor

As a library almost as much as a tool, if possible we should try to support and test as simple/wide a range as we can, without offering too much of a crutch/impediment to others.

We could start a _jinja_compat.py module which normalized the behavior, during the 6.x line: having some try:... ; except ImportError: clauses isn't very expensive, (vs #1685 which is a whole other world), and we can even emit some warnings of our own.

On a future, sensible major version increase, we could then bump the bottom range once and for all: jinja2<3 is no longer supported, and historically, template libraries can be rich sources of security issues.

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 a pull request may close this issue.

3 participants