Fix CI: pin Flask 1.1.2 transitive deps and suppress noqa E402 in test imports#97
Merged
Merged
Conversation
6 tasks
… E402 Co-authored-by: DaTiC0 <13198638+DaTiC0@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add real app tests and standardize test discovery
Fix CI: pin Flask 1.1.2 transitive deps and suppress noqa E402 in test imports
Mar 8, 2026
DaTiC0
marked this pull request as ready for review
March 8, 2026 08:31
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.
The "Python application" CI workflow was failing on two fronts after adding
tests/test_app.py, which importsapp.pydirectly (triggering full Flask initialization at collection time).Summary
What changed:
requirements.txt: pin three transitive dependencies that Flask 1.1.2 is incompatible with at their latest versions:Jinja2>=2.10.1,<3.0.0— Jinja2 3.0 removedescape, imported at module level by Flask 1.1.2itsdangerous>=0.24,<2.0— itsdangerous 2.0 removed thejsonsubmodule used byflask/json/__init__.pyMarkupSafe>=1.1.1,<2.1.0— MarkupSafe 2.1 removedsoft_str, required by Jinja2 2.xtests/test_app.py: add# noqa: E402to the threefrom app import …lines that legitimately followsys.path.insert()Why:
CI was resolving Jinja2→3.1.6, itsdangerous→2.2.0, MarkupSafe→3.0.3 (all unbound in
requirements.txt), causing pytest collection to abort withImportError: cannot import name 'escape' from 'jinja2'. The E402 warnings were surfacing because flake8 flags imports after any executable statement.Validation
make test)make health)AI-Assisted Review (if applicable)
Risk & Rollback
requirements.txtand remove# noqacomments (CI will regress to the same import failure).💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.