Skip to content

Documentation fix - poetry add with square brackets requires quotes #4844

@ttamg

Description

@ttamg

A small documentation fix required to make it more intuitive how to install packages with options. An example would be uvicorn with dependencies such as `uvicorn[standard]'

When using poetry to add this in the default way we get an error

poetry add uvicorn[standard]

The error such as ... zsh: no matches found: uvicorn[standard]. This is on a Mac and using zsh.

Calling the poetry add but using quotes works just fine.

poetry add 'uvicorn[standard]'

It took me 10 mins to find this little hack as this doesn't seem to be a pip requirement. So that others don't have the same hassle, could we make this clear in the documentation please?

The poetry documentation here https://python-poetry.org/docs/cli/#add has the following which I think is misleading

poetry add requests[security,socks]
poetry add "requests[security,socks]~=2.22.0"
poetry add "git+https://github.com/pallets/[email protected][dotenv,dev]"

My suggestion is

  1. Remove the first line as it doesn't work (on Mac anyway)
  2. Add in a note saying that when there are options in [] then make sure you use quotes in the name of the package.

I'd be happy to do the PR on this but first let me know if you think this is a good idea. I see there are 148 PRs open so not sure if they are getting airtime.

Thanks
Matt

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docsDocumentation issues/improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions