poetry icon indicating copy to clipboard operation
poetry copied to clipboard

feat: do not expose cache_version outside of CachedRepository

Open ralbertazzi opened this issue 2 years ago • 0 comments

Pull Request Check List

I believe there's a current leak of abstraction, where the cached_version used in CachedRepository is spread among multiple files in the codebase. The assumption behind it is that the cache version should be associated to a PackageInfo, while I believe that it should be better associated with the generic data stored inside the CachedRepository, regardless of what that data is.

I need it for https://github.com/python-poetry/poetry/pull/7938 as I'd like to store the python constraint inside the cache file (somewhat I prefer it compared to making the python constraint part of the file name, which is less robust due to special characters and whatnot). Still, I believe this should be merged regardless of the destiny of the other PR.

Bonus:

  • Some bare minimal tests for CachedRepository
  • Stronger typing for _get_release_info

ralbertazzi avatar May 17 '23 09:05 ralbertazzi