From 73ee33be99927112130aacf26ea9fce8f8ccb0d3 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 23 Feb 2020 14:43:21 +0200 Subject: [PATCH] Print error in case Poetry configuration failed --- trains_agent/helper/package/poetry_api.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/trains_agent/helper/package/poetry_api.py b/trains_agent/helper/package/poetry_api.py index 11db8f3..ff4efe0 100644 --- a/trains_agent/helper/package/poetry_api.py +++ b/trains_agent/helper/package/poetry_api.py @@ -82,9 +82,13 @@ class PoetryConfig: def initialize(self, cwd=None): if not self._initialized: self._initialized = True - self._config("--local", "virtualenvs.in-project", "true", cwd=cwd) - # self._config("repositories.{}".format(self.REPO_NAME), PYTHON_INDEX) - # self._config("http-basic.{}".format(self.REPO_NAME), *PYTHON_INDEX_CREDENTIALS) + try: + self._config("--local", "virtualenvs.in-project", "true", cwd=cwd) + # self._config("repositories.{}".format(self.REPO_NAME), PYTHON_INDEX) + # self._config("http-basic.{}".format(self.REPO_NAME), *PYTHON_INDEX_CREDENTIALS) + except Exception as ex: + print("Exception: {}\nError: Failed configuring Poetry virtualenvs.in-project".format(ex)) + raise def get_api(self, path): # type: (Path) -> PoetryAPI