developmentseed / eoAPI

[Active Development] Earth Observation API (Metadata, Raster and Vector services)
https://eoapi.dev
MIT License
205 stars 21 forks source link

Pin markupsafe version #33

Closed drnextgis closed 2 years ago

drnextgis commented 2 years ago

https://github.com/pallets/markupsafe/issues/286

>>> import jinja2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/usr/local/lib/python3.9/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/usr/local/lib/python3.9/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.9/site-packages/markupsafe/__init__.py)
vincentsarago commented 2 years ago

@drnextgis Thanks for the PR, I hope you didn't lose too much time on this issue (it took us couple hours early this week 😓 )

I think a better fix will be to pin jinja2>=3.0,<4.0 which should be allowed by other package. In TiTiler as in fastapi we require "jinja2 >=2.11.2,<4.0.0" which will usually mean user will get the latest 3.0.

https://github.com/tiangolo/fastapi/blob/master/pyproject.toml#L89

https://github.com/developmentseed/titiler/pull/436/files#diff-ef5efd645d0059aab13ef237a56af70342972339573c2411199637a1b9a30354R11