From 4540a611dc49f2bc9be5439705f33d1ed6ea5fb8 Mon Sep 17 00:00:00 2001 From: Jury Razumau Date: Tue, 28 Jan 2020 14:58:08 +0300 Subject: [PATCH] send message about failed venv creation --- duro/create/process.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/duro/create/process.py b/duro/create/process.py index c43fded..0e28c64 100644 --- a/duro/create/process.py +++ b/duro/create/process.py @@ -64,7 +64,11 @@ def run_processor( processed_filename: str, ): venv_path = f"./venvs/{table_name}" - subprocess.run(["python", "-m", "venv", venv_path]) + venv_creation_result = subprocess.run(["python3", "-m", "venv", venv_path]) + if venv_creation_result.returncode != 0: + error_message = f"Couldn’t create venv: {venv_creation_result.stderr}" + raise ProcessorRunError(table_name, error_message) + requirements = find_requirements_txt(views_path, table_name) if requirements: subprocess.run([f"{venv_path}/bin/pip", "install", "-r", requirements])