facebook/mariana-trench

ImportError when using sapp

Royalton opened this issue · 3 comments

Bug

Bug description

when ruining sapp --tool=mariana-trench analyze .
even in the sample provided with mariana-trench I get:

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/werkzeug/urls.py)

Reproduction steps

mkdir sample #(inside the mariana-trench root folder)
cd sample

./../build/mariana-trench   --system-jar-configuration-path=$ANDROID_SDK/platforms/android-32/android.jar   --model-generator-configuration-paths=../configuration/default_generator_config.json   --lifecycles-paths=../configuration/lifecycles.json   --rules-paths=../configuration/rules.json   --apk-path=../documentation/sample-app/app/build/outputs/apk/debug/app-debug.apk   --source-root-directory=../documentation/sample-app/app/src/main/java   --model-generator-search-paths=../configuration/model-generators/

sapp --tool=mariana-trench analyze .

Expected behavior
Give a clear and concise description of what you expected to happen.

Logs

(mariana-trench) user@Adroid:~/mariana-trench/sample (main)$ sapp --tool=mariana-trench analyze .
/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/sqlalchemy/orm/relationships.py:1994: SAWarning: Setting backref / back_populates on relationship Run.issue_instances to refer to viewonly relationship IssueInstance.run should include sync_backref=False set on the Run.issue_instances relationship.  (this warning may be suppressed after 10 occurrences)
  util.warn_limited(
/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/sqlalchemy/orm/relationships.py:1994: SAWarning: Setting backref / back_populates on relationship IssueInstance.run to refer to viewonly relationship Run.issue_instances should include sync_backref=False set on the IssueInstance.run relationship.  (this warning may be suppressed after 10 occurrences)
  util.warn_limited(
Traceback (most recent call last):
  File "/home/user/.venvs/mariana-trench/bin/sapp", line 5, in <module>
    from sapp.cli import cli
  File "/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/sapp/cli.py", line 13, in <module>
    from .cli_lib import commands, common_options
  File "/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/sapp/cli_lib.py", line 31, in <module>
    from .ui import filters
  File "/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/sapp/ui/filters.py", line 15, in <module>
    from flask.views import View
  File "/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/flask/app.py", line 27, in <module>
    from . import cli
  File "/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/flask/cli.py", line 17, in <module>
    from .helpers import get_debug_flag
  File "/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/flask/helpers.py", line 14, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/home/user/.venvs/mariana-trench/lib/python3.10/site-packages/werkzeug/urls.py)

Additional context
Add any other context about the problem here.

Solved. I am leaving it open as you may want to fix this in the long term or feel free to close it.

This is an issue with Sapp and Werkzeug 3.0.0 (released Sep 30,2023)

pip uninstall Werkzeug
pip install -Iv Werkzeug==2.3.7

This should be fixed by facebook/sapp@c74c443
We just need to push a new version of fb-sapp but we are having issues building the UI on master.

Leaving this open until we push a new version.