Bump flask from 2.3.3 to 3.1.3#1089
Conversation
Greptile SummaryThis PR bumps Flask from 2.3.3 to 3.1.3 (including security fixes for session access tracking). However, three other pinned dependencies in
Confidence Score: 1/5Not safe to merge — three co-pinned dependencies are broken against Flask 3.x and will prevent the app from starting. Three P1 findings cover hard installation failure (itsdangerous version conflict) and two startup-time ImportErrors (Flask-SQLAlchemy 2.5.1, flask-restx 1.3.0). All three block the application from running at all. requirements.txt — itsdangerous, Flask-SQLAlchemy, and flask-restx all need version bumps before this change can land. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["pip install Flask==3.1.3"] --> B{Resolve dependencies}
B -->|"itsdangerous==2.1.2\n(requires >=2.2)"| C["❌ Dependency conflict\n(install fails)"]
B -->|"Flask-SQLAlchemy==2.5.1"| D["❌ ImportError: _app_ctx_stack\n(removed in Flask 2.3+)"]
B -->|"flask-restx==1.3.0"| E["❌ Import errors\n(Flask 3 needs >=2.0.0)"]
B -->|"Flask-Login==0.6.3\nWerkzeug==3.1.6\nblinker==1.9.0"| F["✅ Compatible"]
|
| Flask==3.1.3 | ||
| Flask-Login==0.6.3 | ||
| flask-restx==1.3.0 | ||
| Flask-SQLAlchemy==2.5.1 |
There was a problem hiding this comment.
Flask-SQLAlchemy 2.5.1 incompatible with Flask 3.x
Flask-SQLAlchemy==2.5.1 imports _app_ctx_stack from flask, which was removed starting in Flask 2.3. Running this with Flask 3.1.3 will raise ImportError: cannot import name '_app_ctx_stack' from 'flask' on startup. You need to upgrade to Flask-SQLAlchemy>=3.0 (note: this is a major version bump with its own breaking changes, such as the session being scoped to the app context and SQLALCHEMY_DATABASE_URI no longer defaulting to in-memory SQLite).
There was a problem hiding this comment.
@greptileai _app_ctx_stack was actually removed in Flask 3.0. Also, flask-bouncer==0.3.0 uses _app_ctx_stack.
There was a problem hiding this comment.
You're right on both points — thanks for the correction. _app_ctx_stack was removed in Flask 3.0, not 2.3 as I stated.
On flask-bouncer: the requirements.txt in this PR shows flask-bouncer==0.3.0, not 0.1.12. Do you know if 0.3.0 still uses _app_ctx_stack? If so, that's an additional blocker alongside Flask-SQLAlchemy==2.5.1 before this upgrade can land.
Tip: You can give me more context with [.greptile/rules](https://www.greptile.com/docs/code-review/custom-standards) so I get this right next time.
Bumps [flask](https://github.com/pallets/flask) from 2.3.3 to 3.1.3. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](pallets/flask@2.3.3...3.1.3) --- updated-dependencies: - dependency-name: flask dependency-version: 3.1.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]>
f03917b to
e2aeb07
Compare
Bumps flask from 2.3.3 to 3.1.3.
Release notes
Sourced from flask's releases.
... (truncated)
Changelog
Sourced from flask's changelog.
... (truncated)
Commits
22d9247release version 3.1.3089cb86Merge commit from forkc17f379request context tracks session access27be933start version 3.1.34e652d3Abort if the instance folder cannot be created (#5903)3d03098Abort if the instance folder cannot be created407eb76document using gevent for async (#5900)ac5664ddocument using gevent for async4f79d5bIncrease required flit_core version to 3.11 (#5865)fe3b215Increase required flit_core version to 3.11