Skip to content

Fix pytest CI failure: upgrade Flask and dependencies to resolve Jinja2 3.x incompatibility#111

Merged
DaTiC0 merged 2 commits intoalert-autofix-19from
copilot/sub-pr-110
Mar 13, 2026
Merged

Fix pytest CI failure: upgrade Flask and dependencies to resolve Jinja2 3.x incompatibility#111
DaTiC0 merged 2 commits intoalert-autofix-19from
copilot/sub-pr-110

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Flask==1.1.2 imports jinja2.escape which was removed in Jinja2 3.0. Since requirements.txt already pins Jinja2>=3.0.0, the test suite failed at import time with ImportError: cannot import name 'escape' from 'jinja2'.

Summary

  • What changed? Updated five dependency version constraints in requirements.txt to versions compatible with Jinja2 3.x and each other.
  • Why? Flask 1.1.2 relies on jinja2.escape (removed in Jinja2 3.0); Flask 2.x uses markupsafe.escape and is fully compatible with the already-required Jinja2 3.x.
Package Before After
Flask ==1.1.2 >=2.0.3,<3.0.0
Flask-SQLAlchemy ==2.5.1 >=3.0.0,<4.0.0
Flask-Login ==0.4.1 >=0.6.0,<1.0.0
SQLAlchemy ==1.4.47 >=1.4.18,<3.0.0
Werkzeug >=2.0.0,<2.4.0 >=2.3.7,<3.0.0

Flask-SQLAlchemy 3.x and Flask-Login 0.6.x are the minimum versions that support Flask 2.x. Flask 2.3 requires Werkzeug ≥ 2.3.7. All 10 existing tests pass locally.

Validation

  • Local checks passed (make test)
  • Runtime check done where relevant (make health)
  • CI checks are green

AI-Assisted Review (if applicable)

  • I used AI assistance for parts of this change
  • I manually reviewed all AI-generated code
  • I verified no secrets/credentials were added

Risk & Rollback

  • Risk level: Low
  • Rollback plan: Revert requirements.txt to the previous pinned versions.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…a2 3.x incompatibility

Co-authored-by: DaTiC0 <13198638+DaTiC0@users.noreply.github.com>
@DaTiC0 DaTiC0 marked this pull request as ready for review March 13, 2026 08:43
@DaTiC0 DaTiC0 merged commit f51dfc3 into alert-autofix-19 Mar 13, 2026
1 check passed
Copy link
Contributor Author

Copilot AI commented Mar 13, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • homegraph.googleapis.com
    • Triggering command: /usr/bin/python3 python3 -m pytest tests/test_app.py -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] [19] Fix workflow permissions for code scanning Fix pytest CI failure: upgrade Flask and dependencies to resolve Jinja2 3.x incompatibility Mar 13, 2026
Copilot AI requested a review from DaTiC0 March 13, 2026 08:43
Copilot stopped work on behalf of DaTiC0 due to an error March 13, 2026 08:43
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.

2 participants