Skip to content

Commit 20ed685

Browse files
committed
Add requested property to BaseDistribution
1 parent f66b3e8 commit 20ed685

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pip/_internal/metadata/base.py

+9
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,15 @@ def installer(self) -> str:
311311
return cleaned_line
312312
return ""
313313

314+
@property
315+
def requested(self) -> bool:
316+
try:
317+
self.read_text("REQUESTED")
318+
except (OSError, ValueError, NoneMetadataError):
319+
return False
320+
else:
321+
return True
322+
314323
@property
315324
def editable(self) -> bool:
316325
return bool(self.editable_project_location)

0 commit comments

Comments
 (0)