Skip to content

Commit 5495f14

Browse files
committed
Add docs example for pip list and editable installs
1 parent ae6427f commit 5495f14

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

docs/html/cli/pip_list.rst

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,93 @@ Examples
139139
docopt==0.6.2
140140
idlex==1.13
141141
jedi==0.9.0
142+
143+
#. List packages installed in editable mode
144+
145+
When some packages are installed in editable mode, ``pip list`` outputs an
146+
additional column that shows the directory where the editable project is
147+
located (i.e. the directory that contains the ``pyproject.toml`` or
148+
``setup.py`` file).
149+
150+
.. tab:: Unix/macOS
151+
152+
.. code-block:: console
153+
154+
$ python -m pip list
155+
Package Version Editable project location
156+
---------------- -------- -------------------------------------
157+
pip 21.2.4
158+
pip-test-package 0.1.1 /home/you/.venv/src/pip-test-package
159+
setuptools 57.4.0
160+
wheel 0.36.2
161+
162+
163+
.. tab:: Windows
164+
165+
.. code-block:: console
166+
167+
C:\> py -m pip list
168+
Package Version Editable project location
169+
---------------- -------- ----------------------------------------
170+
pip 21.2.4
171+
pip-test-package 0.1.1 C:\Users\You\.venv\src\pip-test-package
172+
setuptools 57.4.0
173+
wheel 0.36.2
174+
175+
The json format outputs an additional ``editable_project_location`` field.
176+
177+
.. tab:: Unix/macOS
178+
179+
.. code-block:: console
180+
181+
$ python -m pip list --format=json | jq
182+
[
183+
{
184+
"name": "pip",
185+
"version": "21.2.4",
186+
},
187+
{
188+
"name": "pip-test-package",
189+
"version": "0.1.1",
190+
"editable_project_location": "/home/you/.venv/src/pip-test-package"
191+
},
192+
{
193+
"name": "setuptools",
194+
"version": "57.4.0"
195+
},
196+
{
197+
"name": "wheel",
198+
"version": "0.36.2"
199+
}
200+
]
201+
202+
.. tab:: Windows
203+
204+
.. code-block:: console
205+
206+
C:\> py -m pip list --format=json | jq
207+
[
208+
{
209+
"name": "pip",
210+
"version": "21.2.4",
211+
},
212+
{
213+
"name": "pip-test-package",
214+
"version": "0.1.1",
215+
"editable_project_location": "C:\Users\You\.venv\src\pip-test-package"
216+
},
217+
{
218+
"name": "setuptools",
219+
"version": "57.4.0"
220+
},
221+
{
222+
"name": "wheel",
223+
"version": "0.36.2"
224+
}
225+
]
226+
227+
.. note::
228+
229+
Contrarily to the ``freeze`` comand, ``pip list --format=freeze`` will not
230+
report editable install information, and will report the version of the
231+
package at the time it was installed.

0 commit comments

Comments
 (0)