diff --git a/src/poetry/console/commands/install.py b/src/poetry/console/commands/install.py index 9c928ae2df4..8e716caa2b0 100644 --- a/src/poetry/console/commands/install.py +++ b/src/poetry/console/commands/install.py @@ -155,25 +155,6 @@ def handle(self) -> int: if self.option("no-root"): return 0 - # Prior to https://github.com/python-poetry/poetry-core/pull/629 - # the existence of a module/package was checked when creating the - # EditableBuilder. Afterwards, the existence is checked after - # executing the build script (if there is one), - # i.e. during EditableBuilder.build(). - try: - builder = EditableBuilder(self.poetry, self.env, self.io) - except (ModuleOrPackageNotFound, FileNotFoundError) as e: - # This is likely due to the fact that the project is an application - # not following the structure expected by Poetry - # If this is a true error it will be picked up later by build anyway. - self.line_error( - f"The current project could not be installed: {e}\n" - "If you do not want to install the current project" - " use --no-root", - style="warning", - ) - return 0 - log_install = ( "Installing the current project:" f" {self.poetry.package.pretty_name}" @@ -189,7 +170,13 @@ def handle(self) -> int: self.line("") return 0 + # Prior to https://github.com/python-poetry/poetry-core/pull/629 + # the existence of a module/package was checked when creating the + # EditableBuilder. Afterwards, the existence is checked after + # executing the build script (if there is one), + # i.e. during EditableBuilder.build(). try: + builder = EditableBuilder(self.poetry, self.env, self.io) builder.build() except (ModuleOrPackageNotFound, FileNotFoundError) as e: # This is likely due to the fact that the project is an application