File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
src/pip/_internal/commands Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ Make ``pip show `` show the editable location if package is editable
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ class _PackageInfo(NamedTuple):
53
53
name : str
54
54
version : str
55
55
location : str
56
+ editable_project_location : Optional [str ]
56
57
requires : List [str ]
57
58
required_by : List [str ]
58
59
installer : str
@@ -120,6 +121,7 @@ def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]:
120
121
name = dist .raw_name ,
121
122
version = str (dist .version ),
122
123
location = dist .location or "" ,
124
+ editable_project_location = dist .editable_project_location ,
123
125
requires = requires ,
124
126
required_by = required_by ,
125
127
installer = dist .installer ,
@@ -158,6 +160,8 @@ def print_results(
158
160
write_output ("Author-email: %s" , dist .author_email )
159
161
write_output ("License: %s" , dist .license )
160
162
write_output ("Location: %s" , dist .location )
163
+ if dist .editable_project_location is not None :
164
+ write_output ("Editable project location: %s" , dist .editable_project_location )
161
165
write_output ("Requires: %s" , ", " .join (dist .requires ))
162
166
write_output ("Required-by: %s" , ", " .join (dist .required_by ))
163
167
Original file line number Diff line number Diff line change @@ -24,6 +24,22 @@ def test_basic_show(script: PipTestEnvironment) -> None:
24
24
assert "Requires: " in lines
25
25
26
26
27
+ def test_show_with_editable_project_location (script : PipTestEnvironment ) -> None :
28
+ """
29
+ Test for show command with an editable project installation
30
+ """
31
+ script .pip (
32
+ "install" ,
33
+ "-e" ,
34
+ "git+https://github.com/pypa/pip-test-package.git#egg=pip-test-package" ,
35
+ )
36
+ result = script .pip (
37
+ "show" ,
38
+ "pip_test_package" ,
39
+ )
40
+ assert "Editable project location:" in result .stdout
41
+
42
+
27
43
def test_show_with_files_not_found (script : PipTestEnvironment , data : TestData ) -> None :
28
44
"""
29
45
Test for show command with installed files listing enabled and
You can’t perform that action at this time.
0 commit comments