Skip to content

Commit

Permalink
Add example for dependency with multiple extras (#9138)
Browse files Browse the repository at this point in the history
The currently existing example on how to install dependency extras only shows a single dependency:
`fastapi = {version="^0.92.0", extras=["all"]}`

Since right before this example it is shown how to install multiple extras using the command line interface, this can be confusing and lead to hard to understand missing dependencies:
`poetry install --extras "mysql pgsql"`

Note that the CLI has quotes around both extras and no commas, while in pyproject.toml each extra *must* be quoted and comma-separated, which is currently not documented.

(cherry picked from commit 9cda043)
Signed-off-by: Bjorn Neergaard <bjorn@neersighted.com>
(cherry picked from commit 88311c9)
  • Loading branch information
JSchoeck authored and neersighted committed Mar 24, 2024
1 parent 392adbf commit 27fbab2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,10 @@ poetry install --all-extras
{{% note %}}
Note that `install --extras` and the variations mentioned above (`--all-extras`, `--extras foo`, etc.) only work on dependencies defined in the current project. If you want to install extras defined by dependencies, you'll have to express that in the dependency itself:
```toml
[tool.poetry.dependencies]
pandas = {version="^2.2.1", extras=["computation", "performance"]}
```
```toml
[tool.poetry.group.dev.dependencies]
fastapi = {version="^0.92.0", extras=["all"]}
```
Expand Down

0 comments on commit 27fbab2

Please sign in to comment.