From 331e75748aa5a1546e87c515f4ebc56ab041a527 Mon Sep 17 00:00:00 2001 From: Evan Rittenhouse Date: Sat, 25 Feb 2023 12:48:46 -0600 Subject: [PATCH 1/2] docs: clarify behavior of --extras and subcommands --- docs/pyproject.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/pyproject.md b/docs/pyproject.md index 5149515df8c..6ef9273a760 100644 --- a/docs/pyproject.md +++ b/docs/pyproject.md @@ -395,6 +395,12 @@ You can install all extras with the `--all-extras` option: poetry install --all-extras ``` +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"]} +``` + 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). From 0c555253ef07451cd2624c76435fc29d41d2f940 Mon Sep 17 00:00:00 2001 From: Evan Rittenhouse Date: Sun, 26 Feb 2023 13:04:23 -0600 Subject: [PATCH 2/2] Add note tag --- docs/pyproject.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pyproject.md b/docs/pyproject.md index 6ef9273a760..a344ffc0db5 100644 --- a/docs/pyproject.md +++ b/docs/pyproject.md @@ -395,11 +395,13 @@ 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).