diff --git a/src/poetry/console/commands/command.py b/src/poetry/console/commands/command.py index c6274cabac1..1b30429c78c 100644 --- a/src/poetry/console/commands/command.py +++ b/src/poetry/console/commands/command.py @@ -25,6 +25,14 @@ def poetry(self) -> Poetry: return self._poetry + def set_poetry(self, poetry: Poetry) -> None: + """Explicitly set the current Poetry. + + Useful for Plugins that extends the features of a Poetry CLI Command. + """ + + self._poetry = poetry + def get_application(self) -> Application: from poetry.console.application import Application