Skip to content

Conversation

esafak
Copy link
Contributor

@esafak esafak commented Aug 11, 2025

This continues the work on decoupling caching from the discovery mechanism (#2074).

  • Refactored FileCache's constructor to accept a store_factory function. This factory is responsible for providing a storage object (with locked, read, write methods) for a given cache key.
  • Updated cached_py_info.py to provide the specific factory when it creates the FileCache instance, e.g., lambda key: app_data.py_info(key).
  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

This continues the work on decoupling caching from the discovery mechanism (pypa#2074).

- Refactored `FileCache`'s constructor to accept a `store_factory` function. This factory is responsible for providing a storage object (with `locked`, `read`, `write` methods) for a given cache key.
- Updated `cached_py_info.py` to provide the specific factory when it creates the `FileCache` instance, e.g., `lambda key: app_data.py_info(key)`.

Signed-off-by: Emre Şafak <[email protected]>
@gaborbernat gaborbernat merged commit 02ae86f into pypa:main Aug 11, 2025
45 checks passed
@esafak esafak deleted the feature/2074-decouple-filecache branch August 11, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants