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

'_request_ctx_stack' is deprecated and will be removed in Flask 2.3 #201

Closed jscooksey closed 1 year ago

jscooksey commented 1 year ago

Appreciate this is a waning not a failure. Just thought Id log it as I cant see it at this point. Im getting this while using pytest, under normal flak run it doesn't throw the warning

venv/lib/python3.9/site-packages/flask_debugtoolbar/__init__.py:5
 /......./venv/lib/python3.9/site-packages/flask_debugtoolbar/__init__.py:5: DeprecationWarning:

  '_request_ctx_stack' is deprecated and will be removed in Flask 2.3.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
jeffwidman commented 1 year ago

Hmm, this was fixed in https://github.com/pallets-eco/flask-debugtoolbar/pull/183

What's your entrypoint command? It must be doing something that causes:

if version_builder.parse(flask.__version__) >= version_builder.parse("2.2.0")

to be false.

jeffwidman commented 1 year ago

I'm going to close, as I don't think there's much to do here, and this will go away once we drop support for flask versions < 2.2.

Happy to accept a PR if you end up wanting to tweak the if statement.

leducvin commented 1 year ago

'_request_ctx_stack' is now removed in Flask 3.0.0, and flask-debugtoolbar 0.13.1 still tries to import it.

see: https://flask.palletsprojects.com/en/3.0.x/changes/ https://github.com/pallets/flask/pull/5223/files https://github.com/pallets-eco/flask-debugtoolbar/blob/45d3588bb6985e78ae06194d3ed8bf2de3c56594/src/flask_debugtoolbar/__init__.py#L5