From 4c82bafccb0a4e4fa957d30cbfe8c75d669efb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 28 Aug 2021 15:50:58 +0200 Subject: [PATCH] Remove dead code I have tried to remove the .egg-link (in which case the package is not considered editable), and removing the package while leaving the .egg-link (in which case the package is not shown). I could not produce this "Editable install not found" message with pip 21.2. So I think this is dead code and I'm replacing this test by an assert. --- src/pip/_internal/operations/freeze.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/pip/_internal/operations/freeze.py b/src/pip/_internal/operations/freeze.py index a815d5136b4..be484f47db8 100644 --- a/src/pip/_internal/operations/freeze.py +++ b/src/pip/_internal/operations/freeze.py @@ -170,15 +170,7 @@ def _get_editable_info(dist: BaseDistribution) -> _EditableInfo: if not dist.editable: return _EditableInfo(requirement=None, editable=False, comments=[]) editable_project_location = dist.editable_project_location - if editable_project_location is None: - display = _format_as_name_version(dist) - logger.warning("Editable requirement not found on disk: %s", display) - return _EditableInfo( - requirement=None, - editable=True, - comments=[f"# Editable install not found ({display})"], - ) - + assert editable_project_location location = os.path.normcase(os.path.abspath(editable_project_location)) from pip._internal.vcs import RemoteNotFoundError, RemoteNotValidError, vcs