Skip to content

fix(example): make Flask examples installable with Flask 3.1 - #357

Merged
vmihailenco merged 1 commit into
masterfrom
fix/flask-examples
Nov 1, 2026
Merged

vmihailenco merged 1 commit into
masterfrom
fix/flask-examples

Conversation

@vmihailenco

Copy link
Copy Markdown
Member

Earlier Dependabot bumps (#312, #321) moved the Flask examples to Flask 3.1.3 without updating the rest of the requirements, so pip install -r requirements.txt failed for flask, flask-gunicorn and flask-uwsgi. #328 would have broken flask-auto-instrumentation the same way. CI doesn't install the examples, so it didn't catch this.

Changes:

  • itsdangerous 2.1.2 → 2.2.0 (required by Flask 3.1)
  • flask_sqlalchemy 2.5.1 → 3.1.1 (2.x imports _app_ctx_stack, which Flask removed), and db.engine is accessed inside app.app_context(), as 3.x requires
  • pin sqlalchemy==2.0.55 (the 0.66b0 SQLAlchemy instrumentation supports < 2.1)
  • uWSGI 2.0.22 → 2.0.31 (2.0.22 doesn't build on Python 3.12)
  • pin opentelemetry-instrumentation-logging==0.66b0 (otherwise pip 24.0 fails to resolve it against the 0.66b0 instrumentations)
  • flask-auto-instrumentation: Flask 2.3.2 → 3.1.3 (supersedes chore(deps): bump flask from 2.3.2 to 3.1.3 in /example/flask-auto-instrumentation #328)

Tested on Python 3.12 with pip 24.0: a clean install of each example's requirements, then the example run under its own server (Flask test client, gunicorn, opentelemetry-instrument, uwsgi). /hello/world returns 200 in all four.

Earlier Dependabot bumps moved the Flask examples to Flask 3.1.3 without
updating the rest of the requirements, so none of them could be installed.

- itsdangerous 2.1.2 -> 2.2.0 (required by Flask 3.1)
- flask_sqlalchemy 2.5.1 -> 3.1.1 (2.x imports _app_ctx_stack, removed in Flask 2.3)
  and access db.engine inside an app context, as 3.x requires
- pin sqlalchemy 2.0.x (instrumentation 0.66b0 supports < 2.1)
- uWSGI 2.0.22 -> 2.0.31 (2.0.22 does not build on Python 3.12)
- pin opentelemetry-instrumentation-logging 0.66b0 so pip 24 can resolve
- flask-auto-instrumentation: flask 2.3.2 -> 3.1.3 (supersedes #328)
@vmihailenco
vmihailenco merged commit dd05e04 into master Nov 1, 2026
2 checks passed
@vmihailenco
vmihailenco deleted the fix/flask-examples branch November 1, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant