From 7a50cc9436c86688b91d21c9f7e4b49be71c9d94 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 27 Nov 2022 19:03:48 +0000 Subject: [PATCH] bootstrap.py: Only lookup git ref if `TLJH_BOOTSTRAP_PIP_SPEC` not set test_bootstrap.py: use `--version main` since there are no tags/releases --- bootstrap/bootstrap.py | 14 +++++++------- integration-tests/test_bootstrap.py | 9 ++++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index ba2d4ab..87846d1 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -455,16 +455,16 @@ def main(): if os.environ.get("TLJH_BOOTSTRAP_DEV", "no") == "yes": logger.info("Selected TLJH_BOOTSTRAP_DEV=yes...") tljh_install_cmd.append("--editable") - version = _resolve_git_version(args.version) - tljh_install_cmd.append( - os.environ.get( - "TLJH_BOOTSTRAP_PIP_SPEC", + bootstrap_pip_spec = os.environ.get("TLJH_BOOTSTRAP_PIP_SPEC") + if not bootstrap_pip_spec: + bootstrap_pip_spec = ( "git+https://github.com/jupyterhub/the-littlest-jupyterhub.git@{}".format( - version - ), + _resolve_git_version(args.version) + ) ) - ) + + tljh_install_cmd.append(bootstrap_pip_spec) if initial_setup: logger.info("Installing TLJH installer...") else: diff --git a/integration-tests/test_bootstrap.py b/integration-tests/test_bootstrap.py index b0cdab6..bc97bee 100644 --- a/integration-tests/test_bootstrap.py +++ b/integration-tests/test_bootstrap.py @@ -100,7 +100,14 @@ def run_bootstrap_after_preparing_container( bootstrap_script = get_bootstrap_script_location(container_name, show_progress_page) - exec_flags = ["-i", container_name, "python3", bootstrap_script] + exec_flags = [ + "-i", + container_name, + "python3", + bootstrap_script, + "--version", + "main", + ] if show_progress_page: exec_flags = ( ["-e", "TLJH_BOOTSTRAP_DEV=yes", "-e", "TLJH_BOOTSTRAP_PIP_SPEC=/srv/src"]