Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ttamg opened this issue Nov 29, 2021 · 4 comments · Fixed by #4847
Closed

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

ttamg opened this issue Nov 29, 2021 · 4 comments · Fixed by #4847
Labels
area/docs Documentation issues/improvements

Comments

@ttamg
Copy link
Contributor

ttamg commented Nov 29, 2021

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

@ttamg ttamg added area/docs Documentation issues/improvements status/triage This issue needs to be triaged labels Nov 29, 2021
@ttamg ttamg changed the title poetry add with square brackets requires quotes Documentation fix - poetry add with square brackets requires quotes Nov 29, 2021
@neersighted
Copy link
Member

neersighted commented Nov 29, 2021

This is not related to Poetry, but your shell. ZSH is treating the braces as a special expansion syntax.

That being said, a PR adding double quotes would be welcome -- it's safe in all shells, even if the user is not using a shell that does implicit square brace expansion.

@ttamg
Copy link
Contributor Author

ttamg commented Nov 29, 2021

OK sounds good. I'll make a suggestion and PR then.

@ttamg
Copy link
Contributor Author

ttamg commented Nov 29, 2021

@neersighted OK here's a simple docs PR that adds in comment for these shells that have issues.
#4847

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants