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

ImportError when using sapp #145

Open
Royalton opened this issue Oct 12, 2023 · 3 comments
Open

ImportError when using sapp #145

Royalton opened this issue Oct 12, 2023 · 3 comments

Comments

@Royalton
Copy link

Royalton commented Oct 12, 2023

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.

@Royalton
Copy link
Author

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

@arthaud
Copy link
Contributor

arthaud commented Oct 16, 2023

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.

@arthaud arthaud closed this as completed Oct 16, 2023
@arthaud arthaud reopened this Oct 16, 2023
@arthaud
Copy link
Contributor

arthaud commented Oct 16, 2023

Leaving this open until we push a new version.

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

No branches or pull requests

2 participants