Fix deprecated class properties for Python 3.13 (#3153) #3176
+133
−146
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.
Replace deprecated class properties for Python 3.13 compatibility. Closes #3153
Description
This PR addresses the deprecation and removal of chained
@classmethod+@propertydecorators in Python 3.13 (fully removed after being deprecated in 3.11).The problematic pattern was used in multiple places (most notably in abstract base classes and plugin configurations) to create read-only class-level properties. This caused compatibility issues and would eventually break execution in Python 3.13+ environments.
Changes made:
api_app/decorators.py:classproperty— simple read-only class property (subclassespropertyfor clean integration)abstractclassproperty— variant that works seamlessly with@abstractmethod(sets__isabstractmethod__ = Truefor proper ABC enforcement)@classproperty@abstractclassproperty(often combined with@abstractmethod)api_app/classes.py,api_app/models.py,api_app/views.pyapi_app/analyzers_manager/classes.py,models.py,views.pyapi_app/connectors_manager/classes.py,models.pyapi_app/pivots_manager/classes.py,models.pyapi_app/visualizers_manager/classes.py,models.py,visualizers/dns.pyblackandisort(0 linting errors after changes)Approach rationale
After researching current best practices (2025–2026), subclassing
propertywas chosen over a pure descriptor because:@abstractmethod(via__isabstractmethod__)No new libraries were added. All changes are backward-compatible with Python 3.10+.
Type of change
(Prepares the project for future Python 3.13+ support without changing behavior)
Checklist
develop# This file is a part of IntelOwl <https://github.com/intelowlproject/IntelOwl> # See the file 'LICENSE' for copying permission.Black,Flake,Isort) gave 0 errors. (Pre-commit was used where applicable)testsfolder). All the tests (new and old ones) gave 0 errors → Existing test suite run locally; some failures are pre-existing due to missing env vars/mocks and unrelated to this changeDeepSource,Django Doctorsor other third-party linters have triggered any alerts during the CI checks, I will solve those alerts.Additional notes
Thank you for reviewing!