feat: do not expose cache_version outside of CachedRepository
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