From 1fb4b581dee4f033d62e804f68b3a6202c85a157 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 12 Sep 2023 08:54:36 -0600 Subject: [PATCH] Bug fix for spack stack setup-meta-modules extension: proceed without Python after checking with user --- lib/jcsda-emc/spack-stack/stack/meta_modules.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/jcsda-emc/spack-stack/stack/meta_modules.py b/lib/jcsda-emc/spack-stack/stack/meta_modules.py index 8cdeb06a4be496..f5cc260ef9b4f2 100755 --- a/lib/jcsda-emc/spack-stack/stack/meta_modules.py +++ b/lib/jcsda-emc/spack-stack/stack/meta_modules.py @@ -750,10 +750,21 @@ def setup_meta_modules(): python_dict = get_matched_dict(compiler_install_dir, python_candidate_list) logging.info(" ... stack python providers: '{}'".format(python_dict)) if not python_dict: - raise Exception( - """No matching Python version found. Make sure that the -Python version in the package config matches what spack installed.""" + user_input = input( + "No matching Python version found found, proceed without creating Python modules? (yes/no): " ) + if not user_input.lower() in ["yes", "y"]: + raise Exception( + """"No matching Python version found. Make sure that the +Python version in the package config matches what spack installed.""" + ) + else: + logging.info( + "Metamodule generation completed successfully in {}".format( + meta_module_dir + ) + ) + return for compiler_name in compiler_dict.keys(): for compiler_version in compiler_dict[compiler_name]: