Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8cd7f8b

Browse filesBrowse files
gh-130160: use .. program:: directive for documenting ensurepip CLI (gh-130253)
1 parent 2e3e653 commit 8cd7f8b
Copy full SHA for 8cd7f8b

File tree

1 file changed

+22
-11
lines changed
Filter options

1 file changed

+22
-11
lines changed

‎Doc/library/ensurepip.rst

Copy file name to clipboardExpand all lines: Doc/library/ensurepip.rst
+22-11Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ when creating a virtual environment) or after explicitly uninstalling
4343
Command line interface
4444
----------------------
4545

46+
.. program:: ensurepip
47+
4648
The command line interface is invoked using the interpreter's ``-m`` switch.
4749

4850
The simplest possible invocation is::
@@ -61,26 +63,34 @@ By default, ``pip`` is installed into the current virtual environment
6163
active virtual environment). The installation location can be controlled
6264
through two additional command line options:
6365

64-
* :samp:`--root {dir}`: Installs ``pip`` relative to the given root directory
65-
rather than the root of the currently active virtual environment (if any)
66-
or the default root for the current Python installation.
67-
* ``--user``: Installs ``pip`` into the user site packages directory rather
68-
than globally for the current Python installation (this option is not
69-
permitted inside an active virtual environment).
66+
.. option:: --root <dir>
67+
68+
Installs ``pip`` relative to the given root directory rather than the root
69+
of the currently active virtual environment (if any) or the default root
70+
for the current Python installation.
71+
72+
.. option:: --user
73+
74+
Installs ``pip`` into the user site packages directory rather than globally
75+
for the current Python installation (this option is not permitted inside an
76+
active virtual environment).
7077

7178
By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where
7279
X.Y stands for the version of Python used to invoke ``ensurepip``). The
7380
scripts installed can be controlled through two additional command line
7481
options:
7582

76-
* ``--altinstall``: if an alternate installation is requested, the ``pipX``
77-
script will *not* be installed.
83+
.. option:: --altinstall
7884

79-
* ``--default-pip``: if a "default pip" installation is requested, the
80-
``pip`` script will be installed in addition to the two regular scripts.
85+
If an alternate installation is requested, the ``pipX`` script will *not* be
86+
installed.
8187

82-
Providing both of the script selection options will trigger an exception.
88+
.. option:: --default-pip
89+
90+
If a "default pip" installation is requested, the ``pip`` script will be
91+
installed in addition to the two regular scripts.
8392

93+
Providing both of the script selection options will trigger an exception.
8494

8595
Module API
8696
----------
@@ -136,3 +146,4 @@ Module API
136146
``pip``, but other software should not assume those dependencies will
137147
always be present by default (as the dependencies may be removed in a
138148
future version of ``pip``).
149+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.