diff --git a/news/558A4C36-D46C-428A-A746-62AE555D1FDE.trivial b/news/558A4C36-D46C-428A-A746-62AE555D1FDE.trivial new file mode 100644 index 000000000..e69de29bb diff --git a/src/pip/_internal/cache.py b/src/pip/_internal/cache.py index b534f0cfe..4a793b1f3 100644 --- a/src/pip/_internal/cache.py +++ b/src/pip/_internal/cache.py @@ -1,9 +1,6 @@ """Cache Management """ -# The following comment should be removed at some point in the future. -# mypy: strict-optional=False - import hashlib import json import logging @@ -122,7 +119,7 @@ class Cache(object): return parts def _get_candidates(self, link, canonical_package_name): - # type: (Link, Optional[str]) -> List[Any] + # type: (Link, str) -> List[Any] can_not_cache = ( not self.cache_dir or not canonical_package_name or @@ -185,6 +182,7 @@ class SimpleWheelCache(Cache): def get_path_for_link_legacy(self, link): # type: (Link) -> str parts = self._get_cache_path_parts_legacy(link) + assert self.cache_dir return os.path.join(self.cache_dir, "wheels", *parts) def get_path_for_link(self, link): @@ -204,7 +202,7 @@ class SimpleWheelCache(Cache): :param link: The link of the sdist for which this will cache wheels. """ parts = self._get_cache_path_parts(link) - + assert self.cache_dir # Store wheels within the root cache_dir return os.path.join(self.cache_dir, "wheels", *parts)