Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarkupSafe on 2.1.0 breaks Jinja #1590

Closed
MichaelVoelkel opened this issue Feb 18, 2022 · 4 comments · Fixed by Netcracker/KubeMarine#120
Closed

MarkupSafe on 2.1.0 breaks Jinja #1590

MichaelVoelkel opened this issue Feb 18, 2022 · 4 comments · Fixed by Netcracker/KubeMarine#120

Comments

@MichaelVoelkel
Copy link

MichaelVoelkel commented Feb 18, 2022

The dependency of MarkupSafe just says >=2 but this breaks with the recent update to Jinja.

Traceback (most recent call last):
[9](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:9)
  File "/usr/local/bin/lintly", line 5, in <module>
[10](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:10)
    from lintly.cli import main
[11](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:11)
  File "/usr/local/lib/python3.9/site-packages/lintly/cli.py", line 7, in <module>
[12](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:12)
    from .builds import LintlyBuild
[13](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:13)
  File "/usr/local/lib/python3.9/site-packages/lintly/builds.py", line [14](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:14), in <module>
14
    from .backends.github import GitHubBackend
[15](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:15)
  File "/usr/local/lib/python3.9/site-packages/lintly/backends/__init__.py", line 1, in <module>
[16](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:16)
    from .github import GitHubBackend  # noqa
[17](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:17)
  File "/usr/local/lib/python3.9/site-packages/lintly/backends/github.py", line 11, in <module>
[18](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:18)
    from lintly.formatters import (
[19](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:19)
  File "/usr/local/lib/python3.9/site-packages/lintly/formatters.py", line 6, in <module>
[20](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:20)
    from jinja2 import Environment, FileSystemLoader
[21](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:21)
  File "/usr/local/lib/python3.9/site-packages/jinja2/__init__.py", line 12, in <module>
[22](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:22)
    from .environment import Environment
[23](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:23)
  File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 25, in <module>
[24](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:24)
    from .defaults import BLOCK_END_STRING
[25](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:25)
  File "/usr/local/lib/python3.9/site-packages/jinja2/defaults.py", line 3, in <module>
[26](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:26)
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
[27](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:27)
  File "/usr/local/lib/python3.9/site-packages/jinja2/filters.py", line 13, in <module>
[28](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:28)
    from markupsafe import soft_unicode
[29](https://github.com/fw-dev/FileWave/runs/5245874635?check_suite_focus=true#step:4:29)
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.9/site-packages/markupsafe/__init__.py)

I stumbled upon it by using Lintly that depends on Jinja2.

Edit: changed log, had the wrong one

@davidism
Copy link
Member

davidism commented Feb 18, 2022

Duplicate of #1585

Please read https://hynek.me/articles/semver-will-not-save-you/, then use a tool like pip-tools to pin your dependencies and control when you get updates.

@MichaelVoelkel
Copy link
Author

Erm, your source depends on >=2.0, this is a dependency of Jinja and it breaks Jinja's code, how is this something I should do when using Jinja?

@davidism
Copy link
Member

davidism commented Feb 18, 2022

Duplicate of #1585

You are using an unsupported version of the project, please update to the latest version. Additionally, please read https://hynek.me/articles/semver-will-not-save-you/, then use a tool like pip-tools to pin your dependencies and control when you get updates. Be sure to run your tests with deprecation warnings treated as errors so that you get notified of these types of changes early.

@MichaelVoelkel
Copy link
Author

MichaelVoelkel commented Feb 18, 2022

Ah damn, you are right, sorry. "Fault" is on Lintly then, will open a ticket there.

Although, it might have been nice if you pinned your versions yourself in earlier versions, then outdating would not have been an issue and the unsupported version would not necessitate using pip-tools

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants