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 35
35
install ,
36
36
localize_dist ,
37
37
localize_metadata ,
38
+ localize_package_path ,
38
39
)
39
- from ._functools import apply , method_cache , pass_none
40
+ from ._functools import apply , compose , method_cache , pass_none
40
41
from ._itertools import always_iterable , bucket , unique_everseen
41
42
from ._meta import PackageMetadata , SimplePath
42
43
from .compat import py39 , py311
@@ -529,6 +530,7 @@ def entry_points(self) -> EntryPoints:
529
530
return EntryPoints ._from_text_for (self .read_text ('entry_points.txt' ), self )
530
531
531
532
@property
533
+ @apply (pass_none (compose (list , functools .partial (map , localize_package_path ))))
532
534
def files (self ) -> Optional [List [PackagePath ]]:
533
535
"""Files in this distribution.
534
536
Original file line number Diff line number Diff line change @@ -91,3 +91,13 @@ def localize_metadata(
91
91
if isinstance (input , importlib_metadata ._adapters .Message ):
92
92
return input
93
93
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