diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py index 7b0c55b3e24..828297b17a7 100644 --- a/src/poetry/console/commands/show.py +++ b/src/poetry/console/commands/show.py @@ -211,7 +211,7 @@ def _display_packages_information( with solver.use_environment(self.env): ops = solver.solve().calculate_operations() - required_locked_packages = {op.package for op in ops if not op.skipped} + required_locked_packages = {op.package.name for op in ops if not op.skipped} show_latest = self.option("latest") show_all = self.option("all") @@ -223,7 +223,7 @@ def _display_packages_information( # Computing widths for locked in locked_packages: - if locked not in required_locked_packages and not show_all: + if locked.name not in required_locked_packages and not show_all: continue current_length = len(locked.pretty_name) @@ -300,7 +300,7 @@ def _display_packages_information( color = "cyan" name = locked.pretty_name install_marker = "" - if locked not in required_locked_packages: + if locked.name not in required_locked_packages: if not show_all: continue diff --git a/tests/console/commands/test_show.py b/tests/console/commands/test_show.py index 72aebcb4ea0..a927cee5bf3 100644 --- a/tests/console/commands/test_show.py +++ b/tests/console/commands/test_show.py @@ -1041,7 +1041,10 @@ def test_show_outdated_local_dependencies( tester.execute("--outdated") - expected = """cachy 0.2.0 0.3.0 Cachy package""" + expected = """\ +cachy 0.2.0 0.3.0 +project-with-setup 0.1.1 ../project_with_setup 0.1.2 ../project_with_setup +""" assert ( "\n".join(line.rstrip() for line in tester.io.fetch_output().splitlines()) == expected.rstrip()