From 2a30de418553397eccc285ff0ade7d53afb04d70 Mon Sep 17 00:00:00 2001 From: Kevin Mills Date: Wed, 25 Oct 2023 14:43:36 -0500 Subject: [PATCH 1/8] Add cli option to supply path to the construct yaml file Signed-off-by: Kevin Mills --- constructor/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/constructor/main.py b/constructor/main.py index 130198487..80f47cf7f 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -303,6 +303,12 @@ def main(): action="store", metavar="CONDA_EXE") + p.add_argument('--construct-yaml-path', + help="path to construct YAML file ready by constructor", + action="store", + metavar="CONSTRUCT_YAML_PATH", + default="construct.yaml") + p.add_argument('dir_path', help="directory containing construct.yaml", action="store", From 4f86998476cbb8808ba2b4acc51e6e292c4e7c4b Mon Sep 17 00:00:00 2001 From: Kevin Mills Date: Wed, 25 Oct 2023 14:57:46 -0500 Subject: [PATCH 2/8] Add construct_yaml_path to main_build --- constructor/main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/constructor/main.py b/constructor/main.py index 80f47cf7f..62361f90f 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -66,7 +66,8 @@ def get_output_filename(info): def main_build(dir_path, output_dir='.', platform=cc_platform, verbose=True, cache_dir=DEFAULT_CACHE_DIR, - dry_run=False, conda_exe="conda.exe"): + dry_run=False, conda_exe="conda.exe", + construct_yaml_path="construct.yaml"): logger.info('platform: %s', platform) if not os.path.isfile(conda_exe): sys.exit("Error: Conda executable '%s' does not exist!" % conda_exe) @@ -76,7 +77,7 @@ def main_build(dir_path, output_dir='.', platform=cc_platform, except ValueError: sys.exit("Error: invalid platform string '%s'" % platform) - construct_path = join(dir_path, 'construct.yaml') + construct_path = construct_yaml_path info = construct_parse(construct_path, platform) construct_verify(info) info['CONSTRUCTOR_VERSION'] = __version__ @@ -307,7 +308,8 @@ def main(): help="path to construct YAML file ready by constructor", action="store", metavar="CONSTRUCT_YAML_PATH", - default="construct.yaml") + default=join(os.getcwd(), 'construct.yaml') +) p.add_argument('dir_path', help="directory containing construct.yaml", @@ -317,6 +319,7 @@ def main(): metavar='DIRECTORY') args = p.parse_args() + logger.info("Got the following cli arguments: '%s'", args) if args.verbose or args.debug: @@ -356,7 +359,8 @@ def main(): out_dir = normalize_path(args.output_dir) main_build(dir_path, output_dir=out_dir, platform=args.platform, verbose=args.verbose, cache_dir=args.cache_dir, - dry_run=args.dry_run, conda_exe=conda_exe) + dry_run=args.dry_run, conda_exe=conda_exe, + construct_yaml_path=normalize_path(args.construct_yaml_path)) if __name__ == '__main__': From 030ed6916a06e5551687f2de4ca665bdb37f1ba2 Mon Sep 17 00:00:00 2001 From: Kevin Mills <35641675+millsks@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:46:32 -0500 Subject: [PATCH 3/8] Update constructor/main.py Co-authored-by: jaimergp --- constructor/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constructor/main.py b/constructor/main.py index 62361f90f..9213b9dff 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -77,7 +77,7 @@ def main_build(dir_path, output_dir='.', platform=cc_platform, except ValueError: sys.exit("Error: invalid platform string '%s'" % platform) - construct_path = construct_yaml_path + construct_path = join(dir_path, construct_yaml_filename) info = construct_parse(construct_path, platform) construct_verify(info) info['CONSTRUCTOR_VERSION'] = __version__ From 75816cee44e12768744f1759c3aa947c53f1ce2d Mon Sep 17 00:00:00 2001 From: Kevin Mills <35641675+millsks@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:46:40 -0500 Subject: [PATCH 4/8] Update constructor/main.py Co-authored-by: jaimergp --- constructor/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constructor/main.py b/constructor/main.py index 9213b9dff..170950204 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -67,7 +67,7 @@ def get_output_filename(info): def main_build(dir_path, output_dir='.', platform=cc_platform, verbose=True, cache_dir=DEFAULT_CACHE_DIR, dry_run=False, conda_exe="conda.exe", - construct_yaml_path="construct.yaml"): + construct_yaml_filename="construct.yaml"): logger.info('platform: %s', platform) if not os.path.isfile(conda_exe): sys.exit("Error: Conda executable '%s' does not exist!" % conda_exe) From 56a495464878d8ac76272cf72d0d268521aa9fd3 Mon Sep 17 00:00:00 2001 From: Kevin Mills <35641675+millsks@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:46:47 -0500 Subject: [PATCH 5/8] Update constructor/main.py Co-authored-by: jaimergp --- constructor/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constructor/main.py b/constructor/main.py index 170950204..fe59ea4a4 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -304,7 +304,7 @@ def main(): action="store", metavar="CONDA_EXE") - p.add_argument('--construct-yaml-path', + p.add_argument('--construct-yaml-fn', help="path to construct YAML file ready by constructor", action="store", metavar="CONSTRUCT_YAML_PATH", From 2246820074a7f614885cd4ea0ffd5304eae2a533 Mon Sep 17 00:00:00 2001 From: Kevin Mills <35641675+millsks@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:47:09 -0500 Subject: [PATCH 6/8] Update constructor/main.py Co-authored-by: jaimergp --- constructor/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constructor/main.py b/constructor/main.py index fe59ea4a4..170a63651 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -308,7 +308,7 @@ def main(): help="path to construct YAML file ready by constructor", action="store", metavar="CONSTRUCT_YAML_PATH", - default=join(os.getcwd(), 'construct.yaml') + default="construct.yaml", ) p.add_argument('dir_path', From 3100659cb3f6cf2c65a60a51f20c20cddbe21d23 Mon Sep 17 00:00:00 2001 From: Kevin Mills <35641675+millsks@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:47:30 -0500 Subject: [PATCH 7/8] Update constructor/main.py Co-authored-by: jaimergp --- constructor/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/constructor/main.py b/constructor/main.py index 170a63651..c5d5d6cc8 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -307,7 +307,8 @@ def main(): p.add_argument('--construct-yaml-fn', help="path to construct YAML file ready by constructor", action="store", - metavar="CONSTRUCT_YAML_PATH", + metavar="FILENAME", + dest="construct_yaml_filename", default="construct.yaml", ) From 9262142648d6f9a901d29577e101f5636df2a709 Mon Sep 17 00:00:00 2001 From: Kevin Mills <35641675+millsks@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:47:44 -0500 Subject: [PATCH 8/8] Update constructor/main.py Co-authored-by: jaimergp --- constructor/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constructor/main.py b/constructor/main.py index c5d5d6cc8..c2ce139fb 100644 --- a/constructor/main.py +++ b/constructor/main.py @@ -361,7 +361,7 @@ def main(): main_build(dir_path, output_dir=out_dir, platform=args.platform, verbose=args.verbose, cache_dir=args.cache_dir, dry_run=args.dry_run, conda_exe=conda_exe, - construct_yaml_path=normalize_path(args.construct_yaml_path)) + construct_yaml_path=args.construct_yaml_path if __name__ == '__main__':