Skip to content

Commit

Permalink
Add construct_yaml_path to main_build
Browse files Browse the repository at this point in the history
  • Loading branch information
millsks committed Oct 25, 2023
1 parent 2a30de4 commit 4f86998
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions constructor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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__
Expand Down Expand Up @@ -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",
Expand All @@ -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:
Expand Down Expand Up @@ -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__':
Expand Down

0 comments on commit 4f86998

Please sign in to comment.