mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
bootstrap.py: let --version flag take precedence over env vars
This commit is contained in:
@@ -364,7 +364,7 @@ def main():
|
|||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--version",
|
"--version",
|
||||||
default="latest",
|
default="",
|
||||||
help=(
|
help=(
|
||||||
"TLJH version or Git reference. "
|
"TLJH version or Git reference. "
|
||||||
"Default 'latest' is the most recent release. "
|
"Default 'latest' is the most recent release. "
|
||||||
@@ -478,21 +478,26 @@ def main():
|
|||||||
logger.info("Upgrading pip...")
|
logger.info("Upgrading pip...")
|
||||||
run_subprocess([hub_env_pip, "install", "--upgrade", "pip"])
|
run_subprocess([hub_env_pip, "install", "--upgrade", "pip"])
|
||||||
|
|
||||||
# Install/upgrade TLJH installer
|
# pip install TLJH installer based on
|
||||||
|
#
|
||||||
|
# 1. --version, _resolve_git_version is used
|
||||||
|
# 2. TLJH_BOOTSTRAP_PIP_SPEC (then also respect TLJH_BOOTSTRAP_DEV)
|
||||||
|
# 3. latest, _resolve_git_version is used
|
||||||
|
#
|
||||||
tljh_install_cmd = [hub_env_pip, "install", "--upgrade"]
|
tljh_install_cmd = [hub_env_pip, "install", "--upgrade"]
|
||||||
if os.environ.get("TLJH_BOOTSTRAP_DEV", "no") == "yes":
|
|
||||||
logger.info("Selected TLJH_BOOTSTRAP_DEV=yes...")
|
|
||||||
tljh_install_cmd.append("--editable")
|
|
||||||
|
|
||||||
bootstrap_pip_spec = os.environ.get("TLJH_BOOTSTRAP_PIP_SPEC")
|
bootstrap_pip_spec = os.environ.get("TLJH_BOOTSTRAP_PIP_SPEC")
|
||||||
if not bootstrap_pip_spec:
|
if args.version or not bootstrap_pip_spec:
|
||||||
|
version_to_resolve = args.version or "latest"
|
||||||
bootstrap_pip_spec = (
|
bootstrap_pip_spec = (
|
||||||
"git+https://github.com/jupyterhub/the-littlest-jupyterhub.git@{}".format(
|
"git+https://github.com/jupyterhub/the-littlest-jupyterhub.git@{}".format(
|
||||||
_resolve_git_version(args.version)
|
_resolve_git_version(version_to_resolve)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
elif os.environ.get("TLJH_BOOTSTRAP_DEV", "no") == "yes":
|
||||||
|
logger.info("Selected TLJH_BOOTSTRAP_DEV=yes...")
|
||||||
|
tljh_install_cmd.append("--editable")
|
||||||
tljh_install_cmd.append(bootstrap_pip_spec)
|
tljh_install_cmd.append(bootstrap_pip_spec)
|
||||||
|
|
||||||
if initial_setup:
|
if initial_setup:
|
||||||
logger.info("Installing TLJH installer...")
|
logger.info("Installing TLJH installer...")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user