File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,6 @@ def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> Iterable[_T]:
181181_packages_distributions = lru_cache (None )(packages_distributions )
182182
183183
184- # https://github.com/pdm-project/pdm/blob/fee1e6bffd7de30315e2134e19f9a6f58e15867c/src/pdm/utils.py#L361-L374
185184def is_editable (plugin : Plugin ) -> bool :
186185 """Check if the distribution is installed in editable mode"""
187186 while plugin .parent_plugin :
@@ -193,11 +192,13 @@ def is_editable(plugin: Plugin) -> bool:
193192 with suppress (PackageNotFoundError ):
194193 dist = distribution (plugin .metadata .name )
195194
196- if not dist :
197- with suppress (KeyError , IndexError ):
198- dist = distribution (
199- _packages_distributions ()[plugin .module_name .split ("." )[0 ]][0 ]
200- )
195+ # XXX: 有些包有不正确的 top_level.txt (例如: kiwisolver 的 src),
196+ # 导致下面的代码有可能得出错误的结果. 参见: https://github.com/nucleic/kiwi/issues/169
197+ # if not dist:
198+ # with suppress(KeyError, IndexError):
199+ # dist = distribution(
200+ # _packages_distributions()[plugin.module_name.split(".")[0]][0]
201+ # )
201202
202203 if not dist :
203204 path = files (plugin .module )
You can’t perform that action at this time.
0 commit comments