Skip to content

Quote extras to avoid problems with glob qualifiers in shells #1209

Closed

Description

@matthewfeickert

Some shells, like zsh, have glob qualifiers that will error if an extra is not quoted

$ python -m pip install black[jupyter]
zsh: no matches found: black[jupyter]
$ python -m pip install --upgrade 'black[jupyter]'  # correct way without disabling globbing

Globbing can of course be turned off in these shells, but some users might not think of this right away.

At the moment all the extras in the packaging guide are unquoted:

https://github.com/pypa/packaging.python.org/blob/a103b5699eba73f0266044eeb8eecc6835642a3e/source/guides/installing-using-pip-and-virtual-environments.rst?plain=1#L295

https://github.com/pypa/packaging.python.org/blob/a103b5699eba73f0266044eeb8eecc6835642a3e/source/guides/installing-using-pip-and-virtual-environments.rst?plain=1#L301

https://github.com/pypa/packaging.python.org/blob/a103b5699eba73f0266044eeb8eecc6835642a3e/source/tutorials/installing-packages.rst?plain=1#L656-L658

https://github.com/pypa/packaging.python.org/blob/a103b5699eba73f0266044eeb8eecc6835642a3e/source/tutorials/installing-packages.rst?plain=1#L664-L666

Would a contribution that quotes all these be of interest? Or as this is not necessarily required for installation of an extra should this not be added?

Tagging @pradyunsg on this as the same question applies to pip's docs.

If this is of interest, I have a branch on my fork with this done already that I can PR.

Activity

  1. sinoroc commented on Mar 5, 2023

    @sinoroc
    Contributor

    I think this is would be a good improvement. Square brackets should be quoted. People get tripped up by this relatively often, I see this issue come up in StackOverflow from time to time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions