From 48cbfb76ca608d6085e2ce867c48d6fac4eb126f Mon Sep 17 00:00:00 2001 From: David Hotham Date: Wed, 31 Aug 2022 12:12:30 +0100 Subject: [PATCH] not every GroupCommand needs to be an EnvCommand --- src/poetry/console/commands/group_command.py | 4 ++-- src/poetry/console/commands/installer_command.py | 3 ++- src/poetry/console/commands/show.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/poetry/console/commands/group_command.py b/src/poetry/console/commands/group_command.py index 4c99ca80194..27438bf0c07 100644 --- a/src/poetry/console/commands/group_command.py +++ b/src/poetry/console/commands/group_command.py @@ -5,7 +5,7 @@ from cleo.helpers import option from poetry.core.packages.dependency_group import MAIN_GROUP -from poetry.console.commands.env_command import EnvCommand +from poetry.console.commands.command import Command if TYPE_CHECKING: @@ -13,7 +13,7 @@ from poetry.core.packages.project_package import ProjectPackage -class GroupCommand(EnvCommand): +class GroupCommand(Command): @staticmethod def _group_dependency_options() -> list[Option]: return [ diff --git a/src/poetry/console/commands/installer_command.py b/src/poetry/console/commands/installer_command.py index b361737dac7..7fdceaeb72f 100644 --- a/src/poetry/console/commands/installer_command.py +++ b/src/poetry/console/commands/installer_command.py @@ -2,6 +2,7 @@ from typing import TYPE_CHECKING +from poetry.console.commands.env_command import EnvCommand from poetry.console.commands.group_command import GroupCommand @@ -9,7 +10,7 @@ from poetry.installation.installer import Installer -class InstallerCommand(GroupCommand): +class InstallerCommand(GroupCommand, EnvCommand): def __init__(self) -> None: # Set in poetry.console.application.Application.configure_installer self._installer: Installer | None = None diff --git a/src/poetry/console/commands/show.py b/src/poetry/console/commands/show.py index 2e238147ad5..b80d8c51edb 100644 --- a/src/poetry/console/commands/show.py +++ b/src/poetry/console/commands/show.py @@ -6,6 +6,7 @@ from cleo.helpers import option from packaging.utils import canonicalize_name +from poetry.console.commands.env_command import EnvCommand from poetry.console.commands.group_command import GroupCommand @@ -30,7 +31,7 @@ def reverse_deps(pkg: Package, repo: Repository) -> dict[str, str]: return required_by -class ShowCommand(GroupCommand): +class ShowCommand(GroupCommand, EnvCommand): name = "show" description = "Shows information about packages."