amaranth icon indicating copy to clipboard operation
amaranth copied to clipboard

[amaranth-boards] Jinja2 dependency seems to require pinning of MarkupSafe dependency

Open sporniket opened this issue 2 years ago • 1 comments

After having looked the raw logs of CI for my PR to amaranth-boards, it seems that the jinja2 version used in amaranth relies on an old Markupsafe version (2.0.1), the newer ones (2.1+) have renamed some of their component (here soft_unicode).

Looking at github issues comments on Jinja2 and Markupsafe, one is expected to either pin the markupsafe dependency, or update to latest jinja2.

2022-09-18T10:15:40.7447907Z ======================================================================
2022-09-18T10:15:40.7448394Z ERROR: pmod (unittest.loader._FailedTest)
2022-09-18T10:15:40.7449178Z ----------------------------------------------------------------------
2022-09-18T10:15:40.7449581Z ImportError: Failed to import test module: pmod
2022-09-18T10:15:40.7449907Z Traceback (most recent call last):
2022-09-18T10:15:40.7464918Z   File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
2022-09-18T10:15:40.7465404Z     module = __import__(module_name)
2022-09-18T10:15:40.7466121Z   File "/home/runner/work/amaranth-boards/amaranth-boards/amaranth_boards/extensions/pmod.py", line 3, in <module>
2022-09-18T10:15:40.7466535Z     from amaranth.build import *
2022-09-18T10:15:40.7467182Z   File "/home/runner/work/amaranth-boards/amaranth-boards/.eggs/amaranth-0.3-py3.10.egg/amaranth/build/__init__.py", line 3, in <module>
2022-09-18T10:15:40.7467587Z     from .plat import *
2022-09-18T10:15:40.7468207Z   File "/home/runner/work/amaranth-boards/amaranth-boards/.eggs/amaranth-0.3-py3.10.egg/amaranth/build/plat.py", line 6, in <module>
2022-09-18T10:15:40.7468792Z     import jinja2
2022-09-18T10:15:40.7469399Z   File "/home/runner/work/amaranth-boards/amaranth-boards/.eggs/Jinja2-2.11.3-py3.10.egg/jinja2/__init__.py", line 12, in <module>
2022-09-18T10:15:40.7470086Z     from .environment import Environment
2022-09-18T10:15:40.7470777Z   File "/home/runner/work/amaranth-boards/amaranth-boards/.eggs/Jinja2-2.11.3-py3.10.egg/jinja2/environment.py", line 25, in <module>
2022-09-18T10:15:40.7471247Z     from .defaults import BLOCK_END_STRING
2022-09-18T10:15:40.7471914Z   File "/home/runner/work/amaranth-boards/amaranth-boards/.eggs/Jinja2-2.11.3-py3.10.egg/jinja2/defaults.py", line 3, in <module>
2022-09-18T10:15:40.7472412Z     from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
2022-09-18T10:15:40.7473101Z   File "/home/runner/work/amaranth-boards/amaranth-boards/.eggs/Jinja2-2.11.3-py3.10.egg/jinja2/filters.py", line 13, in <module>
2022-09-18T10:15:40.7473762Z     from markupsafe import soft_unicode
2022-09-18T10:15:40.7474577Z ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/runner/work/amaranth-boards/amaranth-boards/.eggs/MarkupSafe-2.1.1-py3.10-linux-x86_64.egg/markupsafe/__init__.py)

sporniket avatar Sep 19 '22 04:09 sporniket

@whitequark said : I don't think this is an appropriate fix? The amaranth package shouldn't be introducing dependencies to fix issues with its dependent amaranth-boards package. I'll take a closer look at this later if you can't improve on this PR.

Then I'll try to look into the amaranth_board too.

sporniket avatar Sep 20 '22 05:09 sporniket

So this isn't actually an issue with the main branch as here the requirement in setup.py is Jinja2~=3.0.

whitequark avatar Sep 24 '22 06:09 whitequark