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

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

Closed
greyli opened this issue Nov 13, 2023 · 7 comments

Comments

@greyli
Copy link
Member

greyli commented Nov 13, 2023

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
Copy link

ddorian commented Nov 14, 2023

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

@greyli
Copy link
Member Author

greyli commented Nov 14, 2023

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

@macnewbold
Copy link
Contributor

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
Copy link

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

@greyli
Copy link
Member Author

greyli commented Nov 26, 2023

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

@johnchidiac
Copy link

Also anxiously awaiting the release of this fix 😄

@jeffwidman
Copy link
Member

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants