Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not every GroupCommand needs to be an EnvCommand #6282

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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