Skip to content

Commit 9cda043

Browse files
authored
Add example for dependency with multiple extras (#9138)
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.
1 parent 75453c2 commit 9cda043

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/pyproject.md

+4
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,10 @@ poetry install --all-extras
421421
{{% note %}}
422422
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:
423423
```toml
424+
[tool.poetry.dependencies]
425+
pandas = {version="^2.2.1", extras=["computation", "performance"]}
426+
```
427+
```toml
424428
[tool.poetry.group.dev.dependencies]
425429
fastapi = {version="^0.92.0", extras=["all"]}
426430
```

0 commit comments

Comments
 (0)