Skip to content

Commit 773a8f5

Browse files
committed
show: add editable location if package is editable (#11638)
1 parent 5f3f592 commit 773a8f5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

news/11638.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make ``pip show`` show the editable location if package is editable

src/pip/_internal/commands/show.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class _PackageInfo(NamedTuple):
5353
name: str
5454
version: str
5555
location: str
56+
editable_location: Optional[str]
5657
requires: List[str]
5758
required_by: List[str]
5859
installer: str
@@ -120,6 +121,7 @@ def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]:
120121
name=dist.raw_name,
121122
version=str(dist.version),
122123
location=dist.location or "",
124+
editable_location=dist.editable_project_location,
123125
requires=requires,
124126
required_by=required_by,
125127
installer=dist.installer,
@@ -158,6 +160,8 @@ def print_results(
158160
write_output("Author-email: %s", dist.author_email)
159161
write_output("License: %s", dist.license)
160162
write_output("Location: %s", dist.location)
163+
if dist.editable_location:
164+
write_output("Editable project location: %s", dist.editable_location)
161165
write_output("Requires: %s", ", ".join(dist.requires))
162166
write_output("Required-by: %s", ", ".join(dist.required_by))
163167

0 commit comments

Comments
 (0)