From 43e2d3d9bbcea4756d31542e7cf0826ef450d0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6ck?= <38401818+JSchoeck@users.noreply.github.com> Date: Sat, 16 Mar 2024 15:43:08 +0100 Subject: [PATCH] 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. (cherry picked from commit 9cda0435a1007b9970e8c60a45c6e63a014b9b76) Signed-off-by: Bjorn Neergaard --- docs/pyproject.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/pyproject.md b/docs/pyproject.md index 83259cc0a4a..75ad139623c 100644 --- a/docs/pyproject.md +++ b/docs/pyproject.md @@ -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"]} ```