Fix failing CI tests: pin Flask/Werkzeug versions, add weights caching, and downgrade Python to 3.11#2
Fix failing CI tests: pin Flask/Werkzeug versions, add weights caching, and downgrade Python to 3.11#2
Conversation
…g, and downgrade Python to 3.11 Agent-Logs-Url: https://github.com/JayNightmare/Deepface-Mirror/sessions/dcd2a4a8-bb5a-4bf0-b1ea-d4733080e647 Co-authored-by: JayNightmare <34739807+JayNightmare@users.noreply.github.com>
…lities Agent-Logs-Url: https://github.com/JayNightmare/Deepface-Mirror/sessions/dcd2a4a8-bb5a-4bf0-b1ea-d4733080e647 Co-authored-by: JayNightmare <34739807+JayNightmare@users.noreply.github.com>
|
@claude[agent]
This is consistent with your workflow caching weights across runs:
Fix (recommended): make the cache self-healing by validating
|
There was a problem hiding this comment.
Pull request overview
Resolves CI failures by aligning Flask/Werkzeug versions with the test suite’s expectations, improving DeepFace model weight download reliability in CI, and standardizing CI on a TensorFlow/Keras-friendly Python version.
Changes:
- Pin Flask/Werkzeug versions and update the unit test’s Werkzeug version detection to use package metadata.
- Add GitHub Actions caching for
~/.deepface/weightsplus a cleanup step for suspiciously small/corrupted weight files. - Downgrade CI Python version from 3.13.1 to 3.11 across jobs.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
tests/unit/test_api.py |
Updates form-data compatibility gating logic and replaces werkzeug.__version__ with importlib.metadata version lookup. |
requirements.txt |
Pins Flask/Werkzeug to specific versions to avoid known incompatibilities in CI. |
.github/workflows/tests.yml |
Moves CI to Python 3.11, adds DeepFace weights cache and a pre-test cleanup step to reduce flaky downloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/unit/test_api.py
Outdated
| werkzeus_version = version.parse("2.2.3") | ||
| else: | ||
| werkzeus_version = version.parse(werkzeug_version_str) | ||
|
|
||
| threshold_version = version.parse("2.3.0") | ||
| is_testable = flask_version < threshold_version and werkzeus_version < threshold_version |
There was a problem hiding this comment.
The variable name werkzeus_version appears to be a misspelling of werkzeug_version, which makes the version gating logic harder to read/search. Consider renaming it (and the corresponding f-string usage) to werkzeug_version for clarity/consistency with the package name.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Tickets
(Issue linking handled automatically by system)
What has been done
With this PR, CI test failures are resolved by addressing two root causes: (1) Werkzeug/Flask version incompatibility causing
AttributeError: module 'werkzeug' has no attribute '__version__', and (2) corrupted DeepFace model weight downloads in CI.Dependency version fixes:
requirements.txt(patched versions that fix CVE vulnerabilities)test_api.pyto useimportlib.metadata.version()instead ofwerkzeug.__version__attributeCI stability improvements:
~/.deepface/weightsto prevent repeated downloadsBefore:
After:
How to test