File tree 3 files changed +13
-5
lines changed
3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,10 @@ def _files_from_legacy(dist: BaseDistribution) -> Optional[Iterator[str]]:
109
109
return None
110
110
paths = (p for p in text .splitlines (keepends = False ) if p )
111
111
root = dist .location
112
- info = dist .metadata_directory
112
+ info = dist .info_directory
113
113
if root is None or info is None :
114
114
return paths
115
- return (str (pathlib .Path (info , p ).resolve (). relative_to (root )) for p in paths )
115
+ return (str (pathlib .Path (info , p ).relative_to (root )) for p in paths )
116
116
117
117
for query_name in query_names :
118
118
try :
Original file line number Diff line number Diff line change @@ -57,18 +57,26 @@ def location(self) -> Optional[str]:
57
57
A string value is not necessarily a filesystem path, since distributions
58
58
can be loaded from other sources, e.g. arbitrary zip archives. ``None``
59
59
means the distribution is created in-memory.
60
+
61
+ Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If
62
+ this is a symbolic link, we want to preserve the relative path between
63
+ it and files in the distribution.
60
64
"""
61
65
raise NotImplementedError ()
62
66
63
67
@property
64
- def metadata_directory (self ) -> Optional [str ]:
65
- """Location of the metadata directory.
68
+ def info_directory (self ) -> Optional [str ]:
69
+ """Location of the .[egg|dist]-info directory.
66
70
67
71
Similarly to ``location``, a string value is not necessarily a
68
72
filesystem path. ``None`` means the distribution is created in-memory.
69
73
70
74
For a modern .dist-info installation on disk, this should be something
71
75
like ``{location}/{raw_name}-{version}.dist-info``.
76
+
77
+ Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If
78
+ this is a symbolic link, we want to preserve the relative path between
79
+ it and other files in the distribution.
72
80
"""
73
81
raise NotImplementedError ()
74
82
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def location(self) -> Optional[str]:
49
49
return self ._dist .location
50
50
51
51
@property
52
- def metadata_directory (self ) -> Optional [str ]:
52
+ def info_directory (self ) -> Optional [str ]:
53
53
return self ._dist .egg_info
54
54
55
55
@property
You can’t perform that action at this time.
0 commit comments