Skip to content

Commit fcecd11

Browse files
Quote extras to guard shells with glob qualifiers (#1216)
* 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 5cca66a commit fcecd11

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

source/guides/installing-using-pip-and-virtual-environments.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ specifying the extra in brackets:
292292

293293
.. code-block:: bash
294294
295-
python3 -m pip install requests[security]
295+
python3 -m pip install 'requests[security]'
296296
297297
.. tab:: Windows
298298

299299
.. code-block:: bat
300300
301-
py -m pip install requests[security]
301+
py -m pip install "requests[security]"
302302
303303
.. _extras:
304304
https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#optional-dependencies

source/tutorials/installing-packages.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -653,17 +653,17 @@ you know publishes one, you can include it in the pip installation command:
653653

654654
.. code-block:: bash
655655
656-
python3 -m pip install SomePackage[PDF]
657-
python3 -m pip install SomePackage[PDF]==3.0
658-
python3 -m pip install -e .[PDF] # editable project in current directory
656+
python3 -m pip install 'SomePackage[PDF]'
657+
python3 -m pip install 'SomePackage[PDF]==3.0'
658+
python3 -m pip install -e '.[PDF]' # editable project in current directory
659659
660660
.. tab:: Windows
661661

662662
.. code-block:: bat
663663
664-
py -m pip install SomePackage[PDF]
665-
py -m pip install SomePackage[PDF]==3.0
666-
py -m pip install -e .[PDF] # editable project in current directory
664+
py -m pip install "SomePackage[PDF]"
665+
py -m pip install "SomePackage[PDF]==3.0"
666+
py -m pip install -e ".[PDF]" # editable project in current directory
667667
668668
----
669669

0 commit comments

Comments
 (0)