2121
2222def _implementation_name () -> str :
2323 """
24+ Get Python implementation and version.
25+
2426 Similar to PEP 425, however the minor version is separated from the major to
2527 differentiate "3.10" and "31.0".
2628 """
@@ -57,7 +59,8 @@ def read_cache_file(cache_file_path: str) -> CacheDict:
5759
5860class DependencyCache :
5961 """
60- Creates a new persistent dependency cache for the current Python version.
62+ Create new persistent dependency cache for the current Python version.
63+
6164 The cache file is written to the appropriate user cache dir for the
6265 current platform, i.e.
6366
@@ -89,7 +92,9 @@ def cache(self) -> CacheDict:
8992
9093 def as_cache_key (self , ireq : InstallRequirement ) -> CacheKey :
9194 """
92- Given a requirement, return its cache key. This behavior is a little weird
95+ Given a requirement, return its cache key.
96+
97+ This behavior is a little weird
9398 in order to allow backwards compatibility with cache files. For a requirement
9499 without extras, this will return, for example:
95100
@@ -108,7 +113,7 @@ def as_cache_key(self, ireq: InstallRequirement) -> CacheKey:
108113 return name , f"{ version } { extras_string } "
109114
110115 def write_cache (self ) -> None :
111- """Writes the cache to disk as JSON."""
116+ """Write the cache to disk as JSON."""
112117 doc = {"__format__" : 1 , "dependencies" : self ._cache }
113118 with open (self ._cache_file , "w" , encoding = "utf-8" ) as f :
114119 json .dump (doc , f , sort_keys = True )
@@ -135,7 +140,7 @@ def reverse_dependencies(
135140 self , ireqs : Iterable [InstallRequirement ]
136141 ) -> dict [str , set [str ]]:
137142 """
138- Returns a lookup table of reverse dependencies for all the given ireqs.
143+ Return a lookup table of reverse dependencies for all the given ireqs.
139144
140145 Since this is all static, it only works if the dependency cache
141146 contains the complete data, otherwise you end up with a partial view.
@@ -149,7 +154,7 @@ def _reverse_dependencies(
149154 self , cache_keys : Iterable [tuple [str , str ]]
150155 ) -> dict [str , set [str ]]:
151156 """
152- Returns a lookup table of reverse dependencies for all the given cache keys.
157+ Return a lookup table of reverse dependencies for all the given cache keys.
153158
154159 Example input:
155160
0 commit comments