From 07b7a9df29a610f8c7e4325258def4ccdc289908 Mon Sep 17 00:00:00 2001 From: David Vujic Date: Mon, 6 Jan 2025 13:34:18 +0100 Subject: [PATCH] Python 2 adjustments command internals (#74) * fix(build): set the Poetry instance based on if the Poetry Command internals exist * bump version to 1.8.2 --- .../commands/buildproject/project.py | 7 ++++++- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/poetry_multiproject_plugin/commands/buildproject/project.py b/poetry_multiproject_plugin/commands/buildproject/project.py index 86f59ec..b7018e2 100644 --- a/poetry_multiproject_plugin/commands/buildproject/project.py +++ b/poetry_multiproject_plugin/commands/buildproject/project.py @@ -79,7 +79,12 @@ def rewrite_modules(self, project_path: Path, top_ns: str) -> None: def prepare_for_build(self, path: Path): project_poetry = Factory().create_poetry(path) - self.set_poetry(project_poetry) + if hasattr(self, "set_poetry"): + self.set_poetry(project_poetry) + elif hasattr(self, "_poetry"): + self._poetry = project_poetry + else: + raise ValueError("Cannot find expected Poetry Command internals.") def handle(self): path = self.poetry.file.path.absolute() diff --git a/pyproject.toml b/pyproject.toml index dc6589d..898a2ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "poetry-multiproject-plugin" -version = "1.8.1" +version = "1.8.2" description = "A Poetry plugin that makes it possible to use relative package includes." authors = ["David Vujic"] license = "MIT"