diff --git a/src/pip/_internal/metadata/base.py b/src/pip/_internal/metadata/base.py index 10a6c489783..465ff791bfb 100644 --- a/src/pip/_internal/metadata/base.py +++ b/src/pip/_internal/metadata/base.py @@ -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)