File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 3535 install ,
3636 localize_dist ,
3737 localize_metadata ,
38+ localize_package_path ,
3839)
39- from ._functools import apply , method_cache , pass_none
40+ from ._functools import apply , compose , method_cache , pass_none
4041from ._itertools import always_iterable , bucket , unique_everseen
4142from ._meta import PackageMetadata , SimplePath
4243from .compat import py39 , py311
@@ -529,6 +530,7 @@ def entry_points(self) -> EntryPoints:
529530 return EntryPoints ._from_text_for (self .read_text ('entry_points.txt' ), self )
530531
531532 @property
533+ @apply (pass_none (compose (list , functools .partial (map , localize_package_path ))))
532534 def files (self ) -> Optional [List [PackagePath ]]:
533535 """Files in this distribution.
534536
Original file line number Diff line number Diff line change @@ -91,3 +91,13 @@ def localize_metadata(
9191 if isinstance (input , importlib_metadata ._adapters .Message ):
9292 return input
9393 return importlib_metadata ._adapters .Message (input )
94+
95+
96+ def localize_package_path (
97+ input : importlib_metadata .PackagePath | importlib .metadata .PackagePath ,
98+ ) -> importlib_metadata .PackagePath :
99+ if isinstance (input , importlib_metadata .PackagePath ):
100+ return input
101+ replacement = importlib_metadata .PackagePath (input )
102+ vars (replacement ).update (vars (input ))
103+ return replacement
You can’t perform that action at this time.
0 commit comments