Skip to content

Commit

Permalink
Add requested property to BaseDistribution
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Jul 10, 2022
1 parent f66b3e8 commit 20ed685
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pip/_internal/metadata/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,15 @@ def installer(self) -> str:
return cleaned_line
return ""

@property
def requested(self) -> bool:
try:
self.read_text("REQUESTED")
except (OSError, ValueError, NoneMetadataError):
return False
else:
return True

@property
def editable(self) -> bool:
return bool(self.editable_project_location)
Expand Down

0 comments on commit 20ed685

Please sign in to comment.