From ff0705b04bedb7039dae0ab852b2add8d55e7da4 Mon Sep 17 00:00:00 2001
From: Elliot <3186037+elliot-100@users.noreply.github.com>
Date: Thu, 10 Oct 2024 16:00:27 +0100
Subject: [PATCH 1/4] In `show {package}` output, clarify meaning of 'required
by' entries
---
src/poetry/console/commands/show.py | 2 +-
tests/console/commands/test_show.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py
index 6bcd7eca7fb..939c69af4ef 100644
--- a/src/poetry/console/commands/show.py
+++ b/src/poetry/console/commands/show.py
@@ -200,7 +200,7 @@ def _display_single_package_information(
self.line("")
self.line("required by")
for parent, requires_version in required_by.items():
- self.line(f" - {parent} {requires_version}")
+ self.line(f" - {parent} requires {package} {requires_version}")
return 0
diff --git a/tests/console/commands/test_show.py b/tests/console/commands/test_show.py
index 75bb7792349..0d77180f03d 100644
--- a/tests/console/commands/test_show.py
+++ b/tests/console/commands/test_show.py
@@ -1981,7 +1981,7 @@ def test_show_required_by_deps(
- msgpack-python >=0.5 <0.6
required by
- - pendulum >=0.2.0 <0.3.0
+ - pendulum requires cachy >=0.2.0 <0.3.0
""".splitlines()
actual = [line.rstrip() for line in tester.io.fetch_output().splitlines()]
assert actual == expected
From 65ebc1e87fe6e23c5a2ffa64c34e5efe333d8b66 Mon Sep 17 00:00:00 2001
From: elliot-100 <3186037+elliot-100@users.noreply.github.com>
Date: Thu, 10 Oct 2024 16:40:30 +0100
Subject: [PATCH 2/4] docs: update CLI docs
---
docs/cli.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/cli.md b/docs/cli.md
index 67020f2c33c..2f580fb75b5 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -515,7 +515,7 @@ dependencies
- pytzdata >=2017.2.2
required by
- - calendar >=1.4.0
+ - calendar requires pendulum >=1.4.0
```
### Options
From 049e671a9da6ea1ad6804496001d321d93173d53 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Thu, 10 Oct 2024 15:42:48 +0000
Subject: [PATCH 3/4] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
src/poetry/console/commands/show.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py
index 939c69af4ef..bab9f6b16ad 100644
--- a/src/poetry/console/commands/show.py
+++ b/src/poetry/console/commands/show.py
@@ -200,7 +200,9 @@ def _display_single_package_information(
self.line("")
self.line("required by")
for parent, requires_version in required_by.items():
- self.line(f" - {parent} requires {package} {requires_version}")
+ self.line(
+ f" - {parent} requires {package} {requires_version}"
+ )
return 0
From 42d80c91067252eda87c8a61a9cc8511cb318947 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Thu, 10 Oct 2024 15:42:48 +0000
Subject: [PATCH 4/4] Revert addition of package name in `show {package}`
`required-by` output
---
docs/cli.md | 2 +-
src/poetry/console/commands/show.py | 4 +---
tests/console/commands/test_show.py | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/docs/cli.md b/docs/cli.md
index 2f580fb75b5..a7c345f19d5 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -515,7 +515,7 @@ dependencies
- pytzdata >=2017.2.2
required by
- - calendar requires pendulum >=1.4.0
+ - calendar requires >=1.4.0
```
### Options
diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py
index bab9f6b16ad..0784e267da7 100644
--- a/src/poetry/console/commands/show.py
+++ b/src/poetry/console/commands/show.py
@@ -200,9 +200,7 @@ def _display_single_package_information(
self.line("")
self.line("required by")
for parent, requires_version in required_by.items():
- self.line(
- f" - {parent} requires {package} {requires_version}"
- )
+ self.line(f" - {parent} requires {requires_version}")
return 0
diff --git a/tests/console/commands/test_show.py b/tests/console/commands/test_show.py
index 0d77180f03d..c6d9cbddb73 100644
--- a/tests/console/commands/test_show.py
+++ b/tests/console/commands/test_show.py
@@ -1981,7 +1981,7 @@ def test_show_required_by_deps(
- msgpack-python >=0.5 <0.6
required by
- - pendulum requires cachy >=0.2.0 <0.3.0
+ - pendulum requires >=0.2.0 <0.3.0
""".splitlines()
actual = [line.rstrip() for line in tester.io.fetch_output().splitlines()]
assert actual == expected