user env: upgrade jh based on hub spec

This commit is contained in:
Erik Sundell
2023-05-18 23:51:00 +02:00
parent c1aa30a479
commit 21312b2cfd
2 changed files with 10 additions and 8 deletions

View File

@@ -256,11 +256,20 @@ def ensure_user_environment(user_requirements_txt_file):
pypi_pkgs_to_upgrade, pypi_pkgs_to_upgrade,
upgrade=True, upgrade=True,
) )
# Install/upgrade the jupyterhub version in the user env based on the
# version specification used for the hub env.
#
with open(os.path.join(HERE, "requirements-hub-env.txt")) as f:
jh_version_spec = [l for l in f if l.startswith("jupyterhub>=")][0]
conda.ensure_pip_packages(USER_ENV_PREFIX, [jh_version_spec], upgrade=True)
# Install user environment extras for initial installations
#
if is_fresh_install: if is_fresh_install:
conda.ensure_pip_requirements( conda.ensure_pip_requirements(
USER_ENV_PREFIX, USER_ENV_PREFIX,
os.path.join(HERE, "requirements-user-env-extras.txt"), os.path.join(HERE, "requirements-user-env-extras.txt"),
upgrade=True,
) )
if user_requirements_txt_file: if user_requirements_txt_file:

View File

@@ -1,7 +0,0 @@
# When tljh.installer runs, the users' environment as typically found in
# /opt/tljh/user, is installed or upgraded with these packages.
#
# Whats listed here should be only the unconditional requirements that we have in
# the user environment.
#
jupyterhub==4.*