Skip to content

Commit 7d28893

Browse files
authored
Merge pull request #10507 from uranusjr/metadata-type-mismatch-satisfied-by
Fix InstalledDistribution's metadata interface
2 parents f609d35 + 25c64a0 commit 7d28893

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

news/10504.bugfix.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix a crash when installing an editable requirement using the legacy resolver
2+
due to a mismatch in internal metadata representation interfaces.

src/pip/_internal/distributions/installed.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ class InstalledDistribution(AbstractDistribution):
1111
"""
1212

1313
def get_metadata_distribution(self) -> BaseDistribution:
14+
from pip._internal.metadata.pkg_resources import Distribution as _Dist
15+
1416
assert self.req.satisfied_by is not None, "not actually installed"
15-
return self.req.satisfied_by
17+
return _Dist(self.req.satisfied_by)
1618

1719
def prepare_distribution_metadata(
1820
self, finder: PackageFinder, build_isolation: bool

0 commit comments

Comments
 (0)