pallets-eco / flask-debugtoolbar

A toolbar overlay for debugging Flask applications
https://flask-debugtoolbar.readthedocs.io
BSD 3-Clause "New" or "Revised" License
953 stars 146 forks source link

0.13.1 breaks with Flask 3.0: ImportError: cannot import name '_request_ctx_stack' from 'flask.globals #213

Closed greyli closed 11 months ago

greyli commented 1 year ago

Hi, please make a new release to fix the compatible issue with Flask 3.0.

Flask 3.0 removed the _request_ctx_stack variable from flask.globals:

0.676 Error: While importing 'greybook', an ImportError was raised:
0.676
0.676 Traceback (most recent call last):
0.676   File "/home/greybook/venv/lib/python3.12/site-packages/flask/cli.py", line 219, in locate_app
0.676     __import__(module_name)
0.676   File "/home/greybook/greybook/__init__.py", line 3, in <module>
0.676     from greybook.views.admin import admin_bp
0.676   File "/home/greybook/greybook/views/admin.py", line 9, in <module>
0.676     from greybook.core.extensions import db
0.676   File "/home/greybook/greybook/core/extensions.py", line 7, in <module>
0.676     from flask_debugtoolbar import DebugToolbarExtension
0.676   File "/home/greybook/venv/lib/python3.12/site-packages/flask_debugtoolbar/__init__.py", line 5, in <module>
0.676     from flask.globals import _request_ctx_stack
0.676 ImportError: cannot import name '_request_ctx_stack' from 'flask.globals' (/home/greybook/venv/lib/python3.12/site-packages/flask/globals.py)

This issue has been fixed in #183, but no new release yet.

ddorian commented 1 year ago

Even with that it breaks in #214 (I tried by installing from git master branch)

greyli commented 1 year ago

I will help to set up the CI first to make sure the unit tests will pass.

macnewbold commented 1 year ago

I've had my eye on this as well, and noticed the same thing in our builds. I'm happy to help review something here as soon as its ready, and thank you!

nashsophie commented 1 year ago

It's been 2 weeks and the problem is still not solved?

greyli commented 1 year ago

The issue has been fixed, but we are waiting for @jeffwidman @nickjj to make a new release to PyPI.

johnchidiac commented 12 months ago

Also anxiously awaiting the release of this fix 😄

jeffwidman commented 11 months ago

Just pushed it live: https://pypi.org/project/Flask-DebugToolbar/0.14.0/