whiskyechobravo / kerko

A web application component that provides a faceted search interface for bibliographies managed with Zotero.
https://whiskyechobravo.github.io/kerko/
GNU General Public License v3.0
302 stars 36 forks source link

Incompatibility with Jinja2 3.1 (Error importing Markup) #11

Closed pankus closed 1 year ago

pankus commented 1 year ago

This is the error message:

File "/.../venv/lib/python3.10/site-packages/kerko/jinja2.py", line 13, in <module>
    from jinja2 import Markup, evalcontextfilter
ImportError: cannot import name 'Markup' from 'jinja2' (/.../venv/lib/python3.10/site-packages/jinja2/__init__.py)

pip freeze:

alembic==1.8.1
Babel==2.10.3
bibtexparser==1.4.0
Bootstrap-Flask==2.1.0
certifi==2022.9.24
charset-normalizer==2.1.1
click==8.1.3
feedparser==6.0.10
Flask==2.2.2
Flask-Babel==2.0.0
Flask-Migrate==3.1.0
Flask-SQLAlchemy==3.0.2
Flask-WTF==1.0.1
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
Kerko==0.8.1
Mako==1.2.3
MarkupSafe==2.1.1
psycopg2==2.9.4
pyparsing==3.0.9
python-dotenv==0.21.0
pytz==2022.5
pyzotero==1.5.5
requests==2.28.1
sgmllib3k==1.0.0
SQLAlchemy==1.4.42
urllib3==1.26.12
w3lib==2.0.1
Werkzeug==2.2.2
Whoosh==2.7.4
wrapt==1.14.1
WTForms==2.3.3

From Jinja2 3.0.1: Fixed calling deprecated jinja2.Markup without an argument. Use markupsafe.Markup instead. #1438

Downgrading Jinja2 to version 3.0.3 fixes the problem, apparently.

davidlesieur commented 1 year ago

Yes, unfortunately Jinja2 3.1 is not supported until Kerko's code is adapted for the API change. This version constraint is already present in the master branch's setup.cfg. The problem was unknown as of Kerko 0.8.1, thus that version's setup.cfg lacks the constraint. Glad you were able to resolve the issue.

I'll leave this issue open until this is fixed.

davidlesieur commented 1 year ago

Fixed by #17.