From 08d40c15bd3d87b548727c5034fb1cb11bcce6d0 Mon Sep 17 00:00:00 2001
From: Elliot <3186037+elliot-100@users.noreply.github.com>
Date: Mon, 14 Oct 2024 22:47:09 +0100
Subject: [PATCH] feat: in `show {package}` output, clarify meaning of
'required by' entries (#9750)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
docs/cli.md | 2 +-
src/poetry/console/commands/show.py | 2 +-
tests/console/commands/test_show.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/cli.md b/docs/cli.md
index f8cd49cc1fc..42bfb181fc4 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -509,7 +509,7 @@ dependencies
- pytzdata >=2017.2.2
required by
- - calendar >=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 8e13cb87adc..b47b4574666 100644
--- a/src/poetry/console/commands/show.py
+++ b/src/poetry/console/commands/show.py
@@ -195,7 +195,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 {requires_version}")
return 0
diff --git a/tests/console/commands/test_show.py b/tests/console/commands/test_show.py
index cc62cacdcca..22594af6e87 100644
--- a/tests/console/commands/test_show.py
+++ b/tests/console/commands/test_show.py
@@ -1975,7 +1975,7 @@ def test_show_required_by_deps(
- msgpack-python >=0.5 <0.6
required by
- - pendulum >=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