From b1e4fe5d21dc2b8881845f9d5b3be77ba4f79c74 Mon Sep 17 00:00:00 2001 From: Matt Drozt Date: Mon, 11 Sep 2023 13:28:54 -0700 Subject: [PATCH] pretty print error msg when onnx wheel not available --- smartsim/_core/_cli/build.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/smartsim/_core/_cli/build.py b/smartsim/_core/_cli/build.py index b041e1d4e..092fb8f8d 100644 --- a/smartsim/_core/_cli/build.py +++ b/smartsim/_core/_cli/build.py @@ -399,12 +399,16 @@ def execute(args: argparse.Namespace) -> int: backends_str = ", ".join(s.capitalize() for s in backends) if backends else "No" logger.info(f"{backends_str} backend(s) built") - if "torch" in backends: - check_py_torch_version(versions, device) - if "tensorflow" in backends: - check_py_tf_version(versions) - if "onnxruntime" in backends: - check_py_onnx_version(versions) + try: + if "torch" in backends: + check_py_torch_version(versions, device) + if "tensorflow" in backends: + check_py_tf_version(versions) + if "onnxruntime" in backends: + check_py_onnx_version(versions) + except SetupError as e: + logger.error(str(e)) + return 1 logger.info("SmartSim build complete!") return 0