Python and Django upgrade#3352
Python and Django upgrade#3352IshaanXCoder wants to merge 13 commits intointelowlproject:developfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Upgrades the project runtime/tooling to Python 3.13 (and Django 5.2+) and updates dependencies, Docker/CI configs, and tests/code to remain compatible with the newer versions and removed/deprecated APIs.
Changes:
- Bump Python/Django and multiple dependency versions (incl. pydeep → ppdeep), plus CI + Docker base images for 3.13.
- Update application code typing and small behavior adjustments for compatibility (e.g., storage retrieval fallback, Maxmind config lookup).
- Refactor/patch tests to avoid deprecated assertions and to better isolate network/external dependencies.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_crons.py | Makes cron/task tests more isolated via settings overrides and updated mocking. |
| tests/auth/test_oauth.py | Adjusts OAuth test setup to register Google provider when missing. |
| tests/api_app/test_views.py | Replaces deprecated assertDictContainsSubset usage and adds linter suppression. |
| tests/api_app/test_classes.py | Ensures required plugin params are configured in test setup; adjusts failure expectations. |
| tests/api_app/test_api.py | Updates assertions for error payload checks. |
| tests/api_app/ingestors_manager/test_classes.py | Adds required config setup and handles network-related exceptions during ingestor subclass tests. |
| tests/api_app/connectors_manager/test_views.py | Mocks HTTP health-check calls to make tests deterministic. |
| tests/api_app/connectors_manager/test_classes.py | Improves health-check mocking and ensures required params are configured in subclass iteration tests. |
| tests/api_app/analyzers_manager/unit_tests/observable_analyzers/test_greynoise_labs.py | Fixes report mocking to match analyzer expectations. |
| tests/api_app/analyzers_manager/unit_tests/file_analyzers/test_file_info.py | Updates FileInfo unit test mocks after fuzzy-hash library swap. |
| tests/api_app/analyzers_manager/unit_tests/file_analyzers/test_blint_scan.py | Fixes patch target to match analyzer import location. |
| tests/api_app/analyzers_manager/unit_tests/file_analyzers/base_test_class.py | Adds/aligns mimetype→sample mapping for additional filetypes. |
| tests/api_app/analyzers_manager/test_signals.py | Overrides settings to stabilize signal tests under new defaults. |
| requirements/project-requirements.txt | Updates core dependency pins (Django/Celery/etc.) and swaps pydeep → ppdeep. |
| pyproject.toml | Updates Ruff target version to Python 3.13. |
| integrations/tor_analyzers/Dockerfile | Updates integration base image to Python 3.13. |
| integrations/malware_tools_analyzers/Dockerfile | Updates integration base image to Python 3.13. |
| docker/test.override.yml | Minor formatting cleanup in test compose override. |
| docker/Dockerfile | Updates backend build stage Python version to 3.13. |
| async_tests/test_websocket.py | Updates Django test lifecycle hook signature for newer Django behavior. |
| api_app/serializers/job.py | Typing/lint adjustments and small method annotation changes. |
| api_app/interfaces.py | Updates typing for job creation generator. |
| api_app/engines_manager/models.py | Updates typing for generated Celery signatures. |
| api_app/classes.py | Adjusts plugin failure handling behavior (no CI re-raise). |
| api_app/choices.py | Removes PosixPath usage for base paths; updates typing annotation. |
| api_app/analyzers_manager/observable_analyzers/maxmind.py | Fixes Maxmind parameter lookup name and modernizes typing. |
| api_app/analyzers_manager/file_analyzers/phishing/phishing_form_compiler.py | Modernizes typing for redirect handling. |
| api_app/analyzers_manager/file_analyzers/file_info.py | Switches fuzzy hashing from pydeep to ppdeep; Path typing cleanup. |
| api_app/analyzers_manager/classes.py | Makes filepath retrieval compatible with storages lacking retrieve(). |
| .github/workflows/pull_request_automation.yml | Updates workflow Python version to 3.13. |
| .github/workflows/dependency_review.yml | Adds dependency-review license allowlist entry for ppdeep. |
| .github/workflows/codeql-analysis.yml | Updates workflow Python version to 3.13. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@mlodic PTAL whenever free :) |
|
A note: this PR, when merged, would put the develop branch in a state that would require a new major version when releasing. Because of this, merging this could take a while and/or this could be first merge in a separate branch as a buffer and then merged in develop once we are ready to make the major. I'll review this more closely when I'll have more time, this is critical and needs a proper check |
|
Alright it makes sense to me :))
|
|
This pull request has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates or it will be closed in 5 days. |
|
This is under review, not to be closed as of now |
Description
This is a clean version of #3320
This PR resolved #3306 where we're upgrading python version from 3.11 to 3.13
I have updated the necessary configuration files, CI workflows, Docker files, typing errors and test files for compatibility
Type of change
Checklist
developRuff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.DeepSource,Django Doctorsor other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.