From 09cb2e307c4b9850f86e25969975b107239ea04c Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 19 Apr 2024 21:38:00 +0300 Subject: [PATCH] De-duplicate and sort required packages --- pispy/widgets/package_information.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pispy/widgets/package_information.py b/pispy/widgets/package_information.py index e3b8801..b104716 100644 --- a/pispy/widgets/package_information.py +++ b/pispy/widgets/package_information.py @@ -304,8 +304,14 @@ def compose(self) -> ComposeResult: ( "Requires", ", ".join( - f"[@click=screen.lookup('{pkg.project_name}')]{pkg.project_name}[/]" - for pkg in parse_requirements(self._package.requires_dist) + sorted( + set( + f"[@click=screen.lookup('{pkg.project_name}')]{pkg.project_name}[/]" + for pkg in parse_requirements( + self._package.requires_dist + ) + ) + ) ), Value, ),