Skip to content

Commit 9a82bdf

Browse files
Quote extras to guard shells with glob qualifiers
* Shells like zsh have glob qualifiers that will error if an extra is not quoted. While the glob qualifiers can be disabled, adding quotes guards against errors if people are copy-pasting or do not know that they can disable the behavior. * Use single quotes for Linux/Mac and use double quotes for Windows to follow existing style conventions.
1 parent 83c800d commit 9a82bdf

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

docs/html/cli/pip_install.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,21 +386,21 @@ Examples
386386

387387
.. code-block:: shell
388388
389-
python -m pip install SomePackage[PDF]
390-
python -m pip install "SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path"
391-
python -m pip install .[PDF] # project in current directory
392-
python -m pip install SomePackage[PDF]==3.0
393-
python -m pip install SomePackage[PDF,EPUB] # multiple extras
389+
python -m pip install 'SomePackage[PDF]'
390+
python -m pip install 'SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path'
391+
python -m pip install '.[PDF]' # project in current directory
392+
python -m pip install 'SomePackage[PDF]==3.0'
393+
python -m pip install 'SomePackage[PDF,EPUB]' # multiple extras
394394
395395
.. tab:: Windows
396396

397397
.. code-block:: shell
398398
399-
py -m pip install SomePackage[PDF]
399+
py -m pip install "SomePackage[PDF]"
400400
py -m pip install "SomePackage[PDF] @ git+https://git.repo/SomePackage@main#subdirectory=subdir_path"
401-
py -m pip install .[PDF] # project in current directory
402-
py -m pip install SomePackage[PDF]==3.0
403-
py -m pip install SomePackage[PDF,EPUB] # multiple extras
401+
py -m pip install ".[PDF]" # project in current directory
402+
py -m pip install "SomePackage[PDF]==3.0"
403+
py -m pip install "SomePackage[PDF,EPUB]" # multiple extras
404404
405405
#. Install a particular source archive file.
406406

news/11842.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Quote extras in the pip install docs to guard shells with default glob
2+
qualifiers, like zsh.

0 commit comments

Comments
 (0)