Repository navigation
build(backend-py): Upgrade to Flask 3 and Werkzeug 3 - #76
Merged
Merged
Conversation
Upgrade Flask 2.0.3 -> 3.1.3, Werkzeug 2.0.3 -> 3.1.9 and Flask-Cors 3.0.10 -> 6.0.5, along with the pins Flask 3 requires (click, itsdangerous, MarkupSafe, and the new blinker dependency). Remove Flask-SQLAlchemy, which is not imported anywhere and whose pinned 2.5.1 release does not support Flask 3. Bump black to 22.6.0 (the version pre-commit already uses) because black 22.1.0 fails to start with click 8.1+. Flask 2.3 stopped reading FLASK_ENV, so the dev server no longer enables the reloader from .env. Pass --reload in the Dockerfile so the bind-mounted src/ still reloads on change; debug mode stays off. Refs IE-93 Co-Authored-By: Matt Duncan <[email protected]>
Every black release before 26.10.1 is covered by GHSA-cg8m-r9f2-5wm2 (high), which fails dependency-review when the pin changes. Black is not imported by the app and CI runs it through pre-commit, which installs its own pinned copy, so remove it along with the pins only it needed (mypy-extensions, pathspec, platformdirs). Refs IE-93
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades the Python backend's web framework stack. No application code changes.
Refs IE-93.
Changes
backend-py/requirements.txt:backend-py/Dockerfile:CMD ["flask", "run"]→CMD ["flask", "run", "--reload"].Flask 2.3 stopped reading
FLASK_ENV, soFLASK_ENV=developmentin.envno longer turns on the reloader (or the Werkzeug debugger).--reloadkeeps reload-on-change for the bind-mountedsrc/directory. Debug mode stays off. The app's ownFLASK_ENVchecks (e.g.FLASK_ENV == "test") are unaffected.Audit
pip-audit -r backend-py/requirements.txt:main: 24 advisories in Werkzeug (12), Flask-Cors (5), black (4), Flask (2), pytest (1)All Flask, Werkzeug and Flask-Cors advisories are resolved, and black is no longer in
requirements.txt.Verification
In a Python 3.13 container:
pip check: no broken requirementspytest: 56 passed (same asmain)docker compose up backend-py: starts,GET /api/items/returns 200, reportsDebug mode: off, and reloads after editing a file insrc/OrigingetsAccess-Control-Allow-Origin, and a preflightOPTIONSreturns 200 with the allow headers--
View Junior Session [Sentry]