diff --git a/news/11638.bugfix.rst b/news/11638.bugfix.rst new file mode 100644 index 00000000000..04ef930bc1b --- /dev/null +++ b/news/11638.bugfix.rst @@ -0,0 +1 @@ +Make ``pip show`` show the editable location if package is editable diff --git a/src/pip/_internal/commands/show.py b/src/pip/_internal/commands/show.py index 212167c9d1e..8484fe3773c 100644 --- a/src/pip/_internal/commands/show.py +++ b/src/pip/_internal/commands/show.py @@ -53,6 +53,7 @@ class _PackageInfo(NamedTuple): name: str version: str location: str + editable_project_location: Optional[str] requires: List[str] required_by: List[str] installer: str @@ -120,6 +121,7 @@ def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]: name=dist.raw_name, version=str(dist.version), location=dist.location or "", + editable_project_location=dist.editable_project_location, requires=requires, required_by=required_by, installer=dist.installer, @@ -158,6 +160,8 @@ def print_results( write_output("Author-email: %s", dist.author_email) write_output("License: %s", dist.license) write_output("Location: %s", dist.location) + if dist.editable_project_location is not None: + write_output("Editable project location: %s", dist.editable_project_location) write_output("Requires: %s", ", ".join(dist.requires)) write_output("Required-by: %s", ", ".join(dist.required_by))