From 40e650293653e1e2a9e2b721bea5b475a9be6e86 Mon Sep 17 00:00:00 2001 From: James Myatt Date: Thu, 15 Feb 2024 15:40:21 +0000 Subject: [PATCH] Discard duplicated package specifications --- src/pipx/commands/inject.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pipx/commands/inject.py b/src/pipx/commands/inject.py index c8146db45d..aeaa37901b 100644 --- a/src/pipx/commands/inject.py +++ b/src/pipx/commands/inject.py @@ -105,10 +105,10 @@ def inject( suffix: bool = False, ) -> ExitCode: """Returns pipx exit code.""" - # Combined list of packages - packages = list(package_specs) + # Combined collection of package specifications + packages = set(package_specs) for filename in requirement_files: - packages.extend(parse_requirements(filename)) + packages.update(parse_requirements(filename)) if not packages: raise PipxError("No packages have been specified.")