From 294a13136b6e7b5bc3d30ead23cd3bc485f67fd7 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Thu, 16 Feb 2023 03:25:37 -0600 Subject: [PATCH] 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. --- ...installing-using-pip-and-virtual-environments.rst | 4 ++-- source/tutorials/installing-packages.rst | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/guides/installing-using-pip-and-virtual-environments.rst b/source/guides/installing-using-pip-and-virtual-environments.rst index e43e20e27..174dbc8c7 100644 --- a/source/guides/installing-using-pip-and-virtual-environments.rst +++ b/source/guides/installing-using-pip-and-virtual-environments.rst @@ -292,13 +292,13 @@ specifying the extra in brackets: .. code-block:: bash - python3 -m pip install requests[security] + python3 -m pip install 'requests[security]' .. tab:: Windows .. code-block:: bat - py -m pip install requests[security] + py -m pip install "requests[security]" .. _extras: https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#optional-dependencies diff --git a/source/tutorials/installing-packages.rst b/source/tutorials/installing-packages.rst index e03e43732..6fd267112 100644 --- a/source/tutorials/installing-packages.rst +++ b/source/tutorials/installing-packages.rst @@ -653,17 +653,17 @@ you know publishes one, you can include it in the pip installation command: .. code-block:: bash - python3 -m pip install SomePackage[PDF] - python3 -m pip install SomePackage[PDF]==3.0 - python3 -m pip install -e .[PDF] # editable project in current directory + python3 -m pip install 'SomePackage[PDF]' + python3 -m pip install 'SomePackage[PDF]==3.0' + python3 -m pip install -e '.[PDF]' # editable project in current directory .. tab:: Windows .. code-block:: bat - py -m pip install SomePackage[PDF] - py -m pip install SomePackage[PDF]==3.0 - py -m pip install -e .[PDF] # editable project in current directory + py -m pip install "SomePackage[PDF]" + py -m pip install "SomePackage[PDF]==3.0" + py -m pip install -e ".[PDF]" # editable project in current directory ----