Skip to content

Commit dcb6d0c

Browse files
committed
only show build settings for build commands
Fixes #440
1 parent 497073b commit dcb6d0c

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

src/fromager/__main__.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,20 @@ def main(
179179
if error_log_file:
180180
logger.info("logging errors to %s", error_log_file)
181181

182-
logger.info(f"primary settings file: {settings_file}")
183-
logger.info(f"per-package settings dir: {settings_dir}")
184-
logger.info(f"variant: {variant}")
185-
logger.info(f"patches dir: {patches_dir}")
186-
logger.info(f"maximum concurrent jobs: {jobs}")
187-
logger.info(f"constraints file: {constraints_file}")
188-
logger.info(f"wheel server url: {wheel_server_url}")
189-
logger.info(f"network isolation: {network_isolation}")
190-
overrides.log_overrides()
182+
# if ctx.invoked_subcommand is None
183+
if ctx.invoked_subcommand is not None:
184+
cmd = main.commands[str(ctx.invoked_subcommand)]
185+
do_show = getattr(cmd, "_fromager_show_build_settings", False)
186+
if do_show:
187+
logger.info(f"primary settings file: {settings_file}")
188+
logger.info(f"per-package settings dir: {settings_dir}")
189+
logger.info(f"variant: {variant}")
190+
logger.info(f"patches dir: {patches_dir}")
191+
logger.info(f"maximum concurrent jobs: {jobs}")
192+
logger.info(f"constraints file: {constraints_file}")
193+
logger.info(f"wheel server url: {wheel_server_url}")
194+
logger.info(f"network isolation: {network_isolation}")
195+
overrides.log_overrides()
191196

192197
if network_isolation and not SUPPORTS_NETWORK_ISOLATION:
193198
ctx.fail(f"network isolation is not available: {NETWORK_ISOLATION_ERROR}")

src/fromager/commands/bootstrap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,6 @@ def write_constraints_file(
230230
for dv in sorted(versions):
231231
output.write(f"{dep_name}=={dv}\n")
232232
return ret
233+
234+
235+
bootstrap._fromager_show_build_settings = True # type: ignore

src/fromager/commands/build.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def build(
9292
print(wheel_filename)
9393

9494

95+
build._fromager_show_build_settings = True # type: ignore
96+
97+
9598
@click.command()
9699
@click.argument("build_order_file")
97100
@click.option(
@@ -195,6 +198,9 @@ def build_sequence(
195198
_summary(wkctx, entries)
196199

197200

201+
build_sequence._fromager_show_build_settings = True # type: ignore
202+
203+
198204
def _summary(ctx: context.WorkContext, entries: list[BuildSequenceEntry]) -> None:
199205
output: list[typing.Any] = []
200206
now = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%SZ")

0 commit comments

Comments
 (0)