pyvec / naucse

A server for open course material
Other
2 stars 9 forks source link

Problém s Jinja2 3.1 #61

Closed janpipek closed 2 years ago

janpipek commented 2 years ago

Při lokálním puštění naucse pro nový kurz (nainstalováno s 0.5.2 pomocí poetry):

❯ poetry run python -m naucse serve
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse/__main__.py", line 1, in <module>
    from naucse.cli import main
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse/cli.py", line 3, in <module>
    from naucse.views import app
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse/views.py", line 10, in <module>
    from naucse import models
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse/models.py", line 22, in <module>
    from naucse import local_renderer, compiled_renderer
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse/local_renderer.py", line 5, in <module>
    import naucse_render
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse_render/__init__.py", line 1, in <module>
    from .course import get_course, get_course_slugs
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse_render/course.py", line 13, in <module>
    from .markdown import convert_markdown
  File "/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/naucse_render/markdown.py", line 7, in <module>
    from jinja2 import Markup
ImportError: cannot import name 'Markup' from 'jinja2' (/home/honza/code/collaboration/materialy/.venv/lib/python3.9/site-packages/jinja2/__init__.py)

Zafungovalo až při fixním nastavení Jinja2 na ~3.0.0.

Předpokládám, že je to nějaký shuffle v Jinja2 API, ale v naucse kódu se neorientuju, tak do toho nechci moc hrabat.