From b51fdb46f3f3f3090b5fc24cb6b02286dda9270c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 16 Aug 2023 18:46:28 +0200 Subject: [PATCH] fix: ask whether we run as prod in `local launch` User was no longer asked whether they wanted to run on prod or not. In other words, it was not convenient to run as local.overhang.io. --- .../20230816_184458_regis_fix_local_non_prod.md | 1 + tutor/commands/compose.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 changelog.d/20230816_184458_regis_fix_local_non_prod.md diff --git a/changelog.d/20230816_184458_regis_fix_local_non_prod.md b/changelog.d/20230816_184458_regis_fix_local_non_prod.md new file mode 100644 index 0000000..7f80b45 --- /dev/null +++ b/changelog.d/20230816_184458_regis_fix_local_non_prod.md @@ -0,0 +1 @@ +- [Bugfix] Ask whether user wants to run locally during `tutor local launch`. (by @regisb) diff --git a/tutor/commands/compose.py b/tutor/commands/compose.py index 8e66c6d..baa1ca0 100644 --- a/tutor/commands/compose.py +++ b/tutor/commands/compose.py @@ -90,13 +90,13 @@ def launch( skip_build: bool, ) -> None: context_name = context.obj.NAME - run_for_prod = context_name != "dev" + run_for_prod = False if context_name == "dev" else None utils.warn_macos_docker_memory() # Upgrade has to run before configuration - interactive_upgrade(context, not non_interactive, run_for_prod) - interactive_configuration(context, not non_interactive, run_for_prod) + interactive_upgrade(context, not non_interactive, run_for_prod=run_for_prod) + interactive_configuration(context, not non_interactive, run_for_prod=run_for_prod) config = tutor_config.load(context.obj.root) @@ -136,7 +136,7 @@ def launch( def interactive_upgrade( - context: click.Context, interactive: bool, run_for_prod: bool + context: click.Context, interactive: bool, run_for_prod: t.Optional[bool] ) -> None: """ Piece of code that is only used in launch. @@ -187,7 +187,7 @@ Are you sure you want to continue?""" def interactive_configuration( - context: click.Context, interactive: bool, run_for_prod: bool + context: click.Context, interactive: bool, run_for_prod: t.Optional[bool] = None ) -> None: click.echo(fmt.title("Interactive platform configuration")) config = tutor_config.load_minimal(context.obj.root)