Skip to content

Commit 43ead14

Browse files
committed
Add docs example for pip list and editable installs
1 parent 9fe02f4 commit 43ead14

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

docs/html/cli/pip_list.rst

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

0 commit comments

Comments
 (0)