Finds an index from a cache folder and a project path.
(path: str)
| 21 | |
| 22 | |
| 23 | def find_index_from_cache_folder(path: str) -> Path: |
| 24 | """Finds an index from a cache folder and a project path.""" |
| 25 | if is_git_url(path): |
| 26 | data = path.encode("utf-8") |
| 27 | else: |
| 28 | normalized = Path(path).expanduser().resolve() |
| 29 | data = str(normalized).encode("utf-8") |
| 30 | subdir_path = hashlib.new("sha256", data).hexdigest() |
| 31 | cache_dir = resolve_cache_folder() / subdir_path |
| 32 | return cache_dir / "index" |
| 33 | |
| 34 | |
| 35 | def _windows_cache_dir(name: str) -> Path: |