From 5a9d226442480953284f8ba7e3fb5861ebdcdd89 Mon Sep 17 00:00:00 2001 From: Valentin Calomme Date: Fri, 22 Dec 2023 11:10:05 +0100 Subject: [PATCH 1/5] Update description of --why flag for poetry show Changes: - Update description in `docs/cli.md` - Kept the description in the `docs` in sync with the `cli` by updating `src/poetry/console/commands/show.py` Motivation: The current description was unclear. "display why a package is included" could suggest that users could get back a motivation or rationale behind why the package is added. But that's not the case. `--why` returns whether a package is a direct dependency or whether it is itself a dependency of another package in the project. Also see: https://github.com/python-poetry/poetry/issues/8816 --- docs/cli.md | 2 +- src/poetry/console/commands/show.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 787a1afd01f..3a0617225b9 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -503,7 +503,7 @@ required by ### Options * `--without`: The dependency groups to ignore. -* `--why`: When showing the full list, or a `--tree` for a single package, display why a package is included. +* `--why`: When showing the full list, or a `--tree` for a single package, display whether they are direct dependency or required by other packages. * `--with`: The optional dependency groups to include. * `--only`: The only dependency groups to include. * `--no-dev`: Do not list the dev dependencies. (**Deprecated**, use `--without dev` or `--only main` instead) diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py index 8b22e089b8b..74f956fd046 100644 --- a/src/poetry/console/commands/show.py +++ b/src/poetry/console/commands/show.py @@ -49,7 +49,7 @@ class ShowCommand(GroupCommand, EnvCommand): "why", None, "When showing the full list, or a --tree for a single" - " package, also display why it's included.", + " package, display whether they are direct dependency or required by other packages", ), option("latest", "l", "Show the latest version."), option( From b5f5d59ad12572daec4ab756f613fb8a2fcc6aff Mon Sep 17 00:00:00 2001 From: Valentin Calomme Date: Fri, 22 Dec 2023 11:27:54 +0100 Subject: [PATCH 2/5] Fix black formatting --- src/poetry/console/commands/show.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py index 74f956fd046..42e4fdc7aa7 100644 --- a/src/poetry/console/commands/show.py +++ b/src/poetry/console/commands/show.py @@ -48,8 +48,8 @@ class ShowCommand(GroupCommand, EnvCommand): option( "why", None, - "When showing the full list, or a --tree for a single" - " package, display whether they are direct dependency or required by other packages", + "When showing the full list, or a --tree for a single package," + " display whether they are direct dependency or required by other packages", ), option("latest", "l", "Show the latest version."), option( From 7a39c25dd0dcf197da0f57446f34f5c8470eeab1 Mon Sep 17 00:00:00 2001 From: Valentin Calomme Date: Wed, 27 Dec 2023 11:19:13 +0100 Subject: [PATCH 3/5] Update docs/cli.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Process review comments Co-authored-by: Randy Döring <30527984+radoering@users.noreply.github.com> --- docs/cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cli.md b/docs/cli.md index 3a0617225b9..d4bff140c5c 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -503,7 +503,7 @@ required by ### Options * `--without`: The dependency groups to ignore. -* `--why`: When showing the full list, or a `--tree` for a single package, display whether they are direct dependency or required by other packages. +* `--why`: When showing the full list, or a `--tree` for a single package, display whether they are a direct dependency or required by other packages. * `--with`: The optional dependency groups to include. * `--only`: The only dependency groups to include. * `--no-dev`: Do not list the dev dependencies. (**Deprecated**, use `--without dev` or `--only main` instead) From 5df218060bd275e4430a2f51882408d3f87dae66 Mon Sep 17 00:00:00 2001 From: Valentin Calomme Date: Wed, 27 Dec 2023 11:19:21 +0100 Subject: [PATCH 4/5] Update src/poetry/console/commands/show.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Process review comments Co-authored-by: Randy Döring <30527984+radoering@users.noreply.github.com> --- src/poetry/console/commands/show.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py index 42e4fdc7aa7..4eb76544964 100644 --- a/src/poetry/console/commands/show.py +++ b/src/poetry/console/commands/show.py @@ -49,7 +49,7 @@ class ShowCommand(GroupCommand, EnvCommand): "why", None, "When showing the full list, or a --tree for a single package," - " display whether they are direct dependency or required by other packages", + " display whether they are a direct dependency or required by other packages", ), option("latest", "l", "Show the latest version."), option( From 0d8511fc3200074e11db6ada4f76172976a43ef1 Mon Sep 17 00:00:00 2001 From: Valentin Calomme Date: Wed, 27 Dec 2023 11:21:28 +0100 Subject: [PATCH 5/5] Fix formatting --- src/poetry/console/commands/show.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py index 4eb76544964..1208ca4c3c2 100644 --- a/src/poetry/console/commands/show.py +++ b/src/poetry/console/commands/show.py @@ -49,7 +49,8 @@ class ShowCommand(GroupCommand, EnvCommand): "why", None, "When showing the full list, or a --tree for a single package," - " display whether they are a direct dependency or required by other packages", + " display whether they are a direct dependency or required by other" + " packages", ), option("latest", "l", "Show the latest version."), option(