@@ -296,7 +296,10 @@ def _obtain(self, dist: "Distribution", field: str, package_dir: Mapping[str, st
296
296
def _obtain_version (self , dist : "Distribution" , package_dir : Mapping [str , str ]):
297
297
# Since plugins can set version, let's silently skip if it cannot be obtained
298
298
if "version" in self .dynamic and "version" in self .dynamic_cfg :
299
- return _expand .version (self ._obtain (dist , "version" , package_dir ))
299
+ return _expand .version (
300
+ # We already do an early check for the presence of "version"
301
+ self ._obtain (dist , "version" , package_dir ) # pyright: ignore[reportArgumentType]
302
+ )
300
303
return None
301
304
302
305
def _obtain_readme (self , dist : "Distribution" ) -> Optional [Dict [str , str ]]:
@@ -306,9 +309,10 @@ def _obtain_readme(self, dist: "Distribution") -> Optional[Dict[str, str]]:
306
309
dynamic_cfg = self .dynamic_cfg
307
310
if "readme" in dynamic_cfg :
308
311
return {
312
+ # We already do an early check for the presence of "readme"
309
313
"text" : self ._obtain (dist , "readme" , {}),
310
314
"content-type" : dynamic_cfg ["readme" ].get ("content-type" , "text/x-rst" ),
311
- }
315
+ } # pyright: ignore[reportReturnType]
312
316
313
317
self ._ensure_previously_set (dist , "readme" )
314
318
return None
0 commit comments