Skip to content

Commit

Permalink
only show build settings for build commands
Browse files Browse the repository at this point in the history
Fixes #440
  • Loading branch information
dhellmann committed Nov 1, 2024
1 parent 34a4072 commit 264143a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/fromager/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,20 @@ def main(
if error_log_file:
logger.info("logging errors to %s", error_log_file)

logger.info(f"primary settings file: {settings_file}")
logger.info(f"per-package settings dir: {settings_dir}")
logger.info(f"variant: {variant}")
logger.info(f"patches dir: {patches_dir}")
logger.info(f"maximum concurrent jobs: {jobs}")
logger.info(f"constraints file: {constraints_file}")
logger.info(f"wheel server url: {wheel_server_url}")
logger.info(f"network isolation: {network_isolation}")
overrides.log_overrides()
# if ctx.invoked_subcommand is None
if ctx.invoked_subcommand is not None:
cmd = main.commands[str(ctx.invoked_subcommand)]
do_show = getattr(cmd, "_fromager_show_build_settings", False)
if do_show:
logger.info(f"primary settings file: {settings_file}")
logger.info(f"per-package settings dir: {settings_dir}")
logger.info(f"variant: {variant}")
logger.info(f"patches dir: {patches_dir}")
logger.info(f"maximum concurrent jobs: {jobs}")
logger.info(f"constraints file: {constraints_file}")
logger.info(f"wheel server url: {wheel_server_url}")
logger.info(f"network isolation: {network_isolation}")
overrides.log_overrides()

if network_isolation and not SUPPORTS_NETWORK_ISOLATION:
ctx.fail(f"network isolation is not available: {NETWORK_ISOLATION_ERROR}")
Expand Down
3 changes: 3 additions & 0 deletions src/fromager/commands/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,6 @@ def write_constraints_file(
for dv in sorted(versions):
output.write(f"{dep_name}=={dv}\n")
return ret


bootstrap._fromager_show_build_settings = True # type: ignore
6 changes: 6 additions & 0 deletions src/fromager/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def build(
print(wheel_filename)


build._fromager_show_build_settings = True # type: ignore


@click.command()
@click.argument("build_order_file")
@click.option(
Expand Down Expand Up @@ -195,6 +198,9 @@ def build_sequence(
_summary(wkctx, entries)


build_sequence._fromager_show_build_settings = True # type: ignore


def _summary(ctx: context.WorkContext, entries: list[BuildSequenceEntry]) -> None:
output: list[typing.Any] = []
now = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%SZ")
Expand Down

0 comments on commit 264143a

Please sign in to comment.