Skip to content

Commit d54bb20

Browse files
committed
application: make installer configuration public
1 parent a14afb6 commit d54bb20

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/poetry/console/application.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(self) -> None:
107107
dispatcher = EventDispatcher()
108108
dispatcher.add_listener(COMMAND, self.register_command_loggers)
109109
dispatcher.add_listener(COMMAND, self.configure_env)
110-
dispatcher.add_listener(COMMAND, self.configure_installer)
110+
dispatcher.add_listener(COMMAND, self.configure_installer_for_event)
111111
self.set_event_dispatcher(dispatcher)
112112

113113
command_loader = CommandLoader({name: load_command(name) for name in COMMANDS})
@@ -297,8 +297,9 @@ def configure_env(
297297

298298
command.set_env(env)
299299

300-
def configure_installer(
301-
self, event: ConsoleCommandEvent, event_name: str, _: Any
300+
@classmethod
301+
def configure_installer_for_event(
302+
cls, event: ConsoleCommandEvent, event_name: str, _: Any
302303
) -> None:
303304
from poetry.console.commands.installer_command import InstallerCommand
304305

@@ -311,9 +312,10 @@ def configure_installer(
311312
if command.installer is not None:
312313
return
313314

314-
self._configure_installer(command, event.io)
315+
cls.configure_installer_for_command(command, event.io)
315316

316-
def _configure_installer(self, command: InstallerCommand, io: IO) -> None:
317+
@staticmethod
318+
def configure_installer_for_command(command: InstallerCommand, io: IO) -> None:
317319
from poetry.installation.installer import Installer
318320

319321
poetry = command.poetry

src/poetry/console/commands/plugin/add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def handle(self) -> int:
4949

5050
application = cast(Application, self.application)
5151
command: SelfAddCommand = cast(SelfAddCommand, application.find("self add"))
52-
application._configure_installer(command, self.io)
52+
application.configure_installer_for_command(command, self.io)
5353

5454
argv: list[str] = ["add", *self.argument("plugins")]
5555

src/poetry/console/commands/plugin/remove.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def handle(self) -> int:
4343
command: SelfRemoveCommand = cast(
4444
SelfRemoveCommand, application.find("self remove")
4545
)
46-
application._configure_installer(command, self.io)
46+
application.configure_installer_for_command(command, self.io)
4747

4848
argv: list[str] = ["remove", *self.argument("plugins")]
4949

src/poetry/console/commands/self/update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _system_project_handle(self) -> int:
4040
application = cast(Application, self.application)
4141
add_command: AddCommand = cast(AddCommand, application.find("add"))
4242
add_command.set_env(self.env)
43-
application._configure_installer(add_command, self._io)
43+
application.configure_installer_for_command(add_command, self._io)
4444

4545
argv = ["add", f"poetry@{self.argument('version')}"]
4646

0 commit comments

Comments
 (0)