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

Require Flask >= 2.2.0 #224

Closed jeffwidman closed 11 months ago

jeffwidman commented 11 months ago

Require Flask >= 2.2.0.

I'm comfortable going up to requiring 3.x, but when I grep'd for places we use older Flask constructs, this was all I found.

So for now no need to jump further.

Flask 2.2.0 requires Python >= 3.7, so also dropped older pythons.

I also dropped the Python 3.6 test from being required on the repo branch settings.

Fix https://github.com/pallets-eco/flask-debugtoolbar/issues/222

nickjj commented 11 months ago

If we're going to drop support for older versions of Flask I do prefer allowing 2.2+ vs 3.0+.

Based on doing a lot of contract work, it may be surprising at how many folks are using older versions of Flask. One of the biggest Flask apps I've worked with (client) is still running 1.1. It has around ~500k lines of Flask / Python code. They use this extension but I think they would be fine sticking with the latest 0.14 release.

One of the orgs I worked with recently was running 2.0 for a long time and recently upgraded to 3.0.

For context:

jeffwidman commented 11 months ago

It doesn't surprise me. I've worked in the real world too. 😁

Agree it's a reasonable request, so I switched from 3.0 to 2.2.0 as the minimum.

As a consequence, 2.2.0 requires Python 3.7, so we also drop support for Python 2.7/3.6. IMO that's fine as both have been EOL'd for a while, so anyone still on that old version of Python is unlikely to be updating a small random Flask extension.

jeffwidman commented 11 months ago

Let's hold off on merging this for a few weeks just to ensure our release of the 0.14.x series is stable and we don't encounter more blocker bugs like:

Also IMO merging this will result in at least a 0.15.0 version bump, possibly higher depending on if we go semver or not.

nickjj commented 11 months ago

Just to give us some confidence, I pulled 0.14.1 into a real Flask 3.0 project and it's all good. There are deprecation warnings to address which should still work with Flask 2.2.0.

jeffwidman commented 11 months ago

Nice, thanks for checking that!

From what I can tell, this PR actually removes all usage of flask.__version__, so merging this will also resolve that deprecation warning.