From 85d56a74a595bac5b4423ace5462bc7452cfacbb Mon Sep 17 00:00:00 2001 From: Irides Date: Wed, 30 Mar 2022 15:49:26 -0500 Subject: [PATCH] build.plat,setup: fix Jinja2 dependency. 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. --- amaranth/build/plat.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amaranth/build/plat.py b/amaranth/build/plat.py index ca2d1d8..6fc6ad0 100644 --- a/amaranth/build/plat.py +++ b/amaranth/build/plat.py @@ -375,7 +375,7 @@ class TemplatedPlatform(Platform): else: return jinja2.Undefined(name=var) - @jinja2.contextfunction + @jinja2.pass_context def invoke_tool(context, name): env_var = tool_env_var(name) if context.parent["syntax"] == "sh": diff --git a/setup.py b/setup.py index 3f9394b..28116d6 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ setup( "importlib_metadata; python_version<'3.8'", # for __version__ and amaranth._toolchain.yosys "importlib_resources; python_version<'3.9'", # for amaranth._toolchain.yosys "pyvcd~=0.2.2", # for amaranth.pysim - "Jinja2>=2.11,<4.0", # for amaranth.build + "Jinja2~=3.0", # for amaranth.build ], extras_require={ # this version requirement needs to be synchronized with the one in amaranth.back.verilog!