From 459422570dbaf8fad72c8aa05b51496622669508 Mon Sep 17 00:00:00 2001 From: Evan Rittenhouse Date: Sat, 4 Mar 2023 07:18:18 -0600 Subject: [PATCH] docs: clarify behavior of --extras and subcommands (#7563) (cherry picked from commit 6a0087b4cab3097ac332cbd649faf8cc70e1db9c) --- docs/pyproject.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/pyproject.md b/docs/pyproject.md index 5149515df8c..a344ffc0db5 100644 --- a/docs/pyproject.md +++ b/docs/pyproject.md @@ -395,6 +395,14 @@ You can install all extras with the `--all-extras` option: 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.group.dev.dependencies] +fastapi = {version="^0.92.0", extras=["all"]} +``` +{{% /note %}} + When installing or specifying Poetry-built packages, the extras defined in this section can be activated as described in [PEP 508](https://www.python.org/dev/peps/pep-0508/#extras).