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

Support "standard" square bracket syntax for package extras #429

Closed
1 task done
ulope opened this issue Sep 12, 2018 · 13 comments
Closed
1 task done

Support "standard" square bracket syntax for package extras #429

ulope opened this issue Sep 12, 2018 · 13 comments

Comments

@ulope
Copy link

ulope commented Sep 12, 2018

  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

It would be great if poetry would support the "standard" square bracket syntax to specify package extras (i.e. somepackage[someextra]).

I'm aware of the -E option but it's a departure from what other tools are doing and also it's not immediately clear how to specify multiple different extras for multiple packages.

@vab2048
Copy link

vab2048 commented Oct 3, 2019

What is the recommended way of installing extras?

In other words what would be the equivalent of the command pip install dash[testing]?

@sdispater
Copy link
Member

This is supported in the latest prereleases of the 1.0.0 release and will be globally available when it's officially released.

@arn314
Copy link

arn314 commented Mar 17, 2020

I'm unable to make use of this feature. The following is my pyproject.toml contents excerpt:

[tool.poetry.dependencies]
python = "^3.7"
...
testcontainers[postgresql] = "2.6.0"

This one throws the following error when issuing poetry install -v --dry-run

[UnexpectedCharError]
Unexpected character: u'p' at line 24 col 15

which is the character p in testcontainers[postgresql].
I would appreciate if someone can point to any workaround. Thanks!

poetry --version
Poetry version 1.0.5

@clintonroy
Copy link
Contributor

If you try:

poetry add testcontainers[postgresql]

You'll get:

testcontainers = {extras = ["postgresql"], version = "^2.6.0"}

@arn314
Copy link

arn314 commented Mar 17, 2020

That helped. Appreciate the quick response @clintonroy !

@JulianFerry
Copy link

For anyone stumbling on this with the same issue as me:

  • poetry add apache-beam[gcp] errors with zsh: no matches found: apache-beam[gcp]
  • Writing poetry add "apache-beam[gcp]" fixed this

@tpvasconcelos
Copy link

@JulianFerry the issue you are experiencing is probably due to zsh's use of square brackets for globbing.

@virajkanwade
Copy link

This still seems to be an issue.

poetry add 'piccolo[postgres]' 'piccolo[orjson]' 'piccolo[uvloop]'

It only seems to add the last extra in the pyproject.toml.

If I run poetry add 'piccolo[orjson]' followed by poetry add 'piccolo[postgres]'

It removed orjson and only has piccolo = {extras = ["postgres"], version = "^0.74.3"} in toml.

@abn
Copy link
Member

abn commented May 12, 2022

What you are looking for is poetry add 'piccolo[postgresql,orjson,uvloop]'.

@virajkanwade
Copy link

piccolo = {extras = ["postgres", "orjson", "uvloop"], version = "^0.74.3"}

@virajkanwade
Copy link

If you manually set pyproject.toml, it installs everything properly. So it seems to be an issue with poetry add

@sur0g
Copy link

sur0g commented May 6, 2023

zsh user here. I can confirm that it causes issues as @tpvasconcelos mentioned

Copy link

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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants