You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make CacheManager a deprecated subclass of FileCache #147
CacheManager and FileCache would otherwise be two implementations of the same file format that can drift apart.
Current behavior
lettucedetect/detectors/cache.py:12-47 is a standalone class: get, set, delete, _hash (static), path. It is imported by llm.py:12.
Steps
Rewrite CacheManager(file_path) as a subclass of FileCache keeping get, set, delete, _hash and path. It inherits aget, aset and adelete from FileCache and adds no override; the async pairs are new names, so they don't warn on their own.
isinstance(CacheManager(p), FileCache); constructing from a test module warns LettuceDetectDeprecationWarning naming FileCache.
CacheManager has working aget, aset and adelete equal to get, set and delete (a value set with set reads via aget); calling them emits no extra warning beyond the one from construction.
_hash still returns the recorded strings; get/set/delete/path behave as before.
Docstring has the .. deprecated:: note.
Existing tests pass.
Start here
uv run --extra dev pytest tests/test_golden_factory_cache_pytest.py tests/test_llm_detector_pytest.py -q
Activity
refactor: make CacheManager a deprecated subclass of FileCache (#147)