Skip to content

Fix Jinja2 dependency #689

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

Merged
merged 1 commit into from
Mar 30, 2022
Merged

Fix Jinja2 dependency #689

merged 1 commit into from
Mar 30, 2022

Conversation

Lunaphied
Copy link
Contributor

@Lunaphied Lunaphied commented Mar 30, 2022

This PR fixes #688 by upgrading the Jinja2 dependency to minimum of major version 3, which does not have the issue with it's markupsafe dependency being incorrect. In order to do this, update the uses of @jinja2.contextfunction to use the non-deprecated @jinja2.pass_context name instead, as this name will be removed in Jinja2 versions >=3.1.0.

Jinja2 version 2.11 has a broken dependency constraint that allows its
dependency on markupsafe to pull in a version that it is not actually
compatible with the interface of. Fix this by upgrading the dependency
to `~=3.0`. This requires a small patch to the code to replace the
deprecated `@jinja2.contextfunction` decorator with the replacement
`@jinja2.pass_context`since `@jinja2.contextfunction` is removed in
Jinja2 version 3.1.0.
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2022

Codecov Report

Merging #689 (95ffa9c) into main (f6253b3) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #689   +/-   ##
=======================================
  Coverage   81.32%   81.32%           
=======================================
  Files          49       49           
  Lines        6467     6467           
  Branches     1526     1526           
=======================================
  Hits         5259     5259           
- Misses       1016     1017    +1     
+ Partials      192      191    -1     
Impacted Files Coverage Δ
amaranth/build/plat.py 27.44% <0.00%> (ø)
amaranth/build/run.py 21.73% <0.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Member

@whitequark whitequark left a comment

Choose a reason for hiding this comment

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

LGTM

@whitequark whitequark merged commit 85d56a7 into amaranth-lang:main Mar 30, 2022
@whitequark
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Dependency issue: "ImportError: cannot import name 'soft_unicode' from 'markupsafe'"
3 participants