Skip to content

Commit

Permalink
not every GroupCommand needs to be an EnvCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored and neersighted committed Aug 31, 2022
1 parent 59a38bd commit 81c7d00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/poetry/console/commands/group_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
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:
from cleo.io.inputs.option import Option
from poetry.core.packages.project_package import ProjectPackage


class GroupCommand(EnvCommand):
class GroupCommand(Command):
@staticmethod
def _group_dependency_options() -> list[Option]:
return [
Expand Down
3 changes: 2 additions & 1 deletion src/poetry/console/commands/installer_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

from typing import TYPE_CHECKING

from poetry.console.commands.env_command import EnvCommand
from poetry.console.commands.group_command import GroupCommand


if TYPE_CHECKING:
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
Expand Down
3 changes: 2 additions & 1 deletion src/poetry/console/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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."

Expand Down

0 comments on commit 81c7d00

Please sign in to comment.