mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
user env: only upgrade jupyterhub in user env when upgrading tljh
This commit is contained in:
committed by
Erik Sundell
parent
814c6daa40
commit
a86e4ce153
@@ -200,6 +200,8 @@ def ensure_user_environment(user_requirements_txt_file):
|
||||
|
||||
# Case 1: no existing environment
|
||||
if not package_versions:
|
||||
is_fresh_install = True
|
||||
|
||||
# 1a. no environment, but prefix exists.
|
||||
# Abort to avoid clobbering something we don't recognize
|
||||
if os.path.exists(USER_ENV_PREFIX) and os.listdir(USER_ENV_PREFIX):
|
||||
@@ -219,6 +221,8 @@ def ensure_user_environment(user_requirements_txt_file):
|
||||
# quick sanity check: we should have conda and mamba!
|
||||
assert "conda" in package_versions
|
||||
assert "mamba" in package_versions
|
||||
else:
|
||||
is_fresh_install = False
|
||||
|
||||
# next, check Python
|
||||
python_version = package_versions["python"]
|
||||
@@ -259,9 +263,15 @@ def ensure_user_environment(user_requirements_txt_file):
|
||||
|
||||
conda.ensure_pip_requirements(
|
||||
USER_ENV_PREFIX,
|
||||
os.path.join(HERE, "requirements-base.txt"),
|
||||
os.path.join(HERE, "requirements-user-env.txt"),
|
||||
upgrade=True,
|
||||
)
|
||||
if is_fresh_install:
|
||||
conda.ensure_pip_requirements(
|
||||
USER_ENV_PREFIX,
|
||||
os.path.join(HERE, "requirements-user-env-extras.txt"),
|
||||
upgrade=True,
|
||||
)
|
||||
|
||||
if user_requirements_txt_file:
|
||||
# FIXME: This currently fails hard, should fail soft and not abort installer
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# When tljh.installer runs, the users' environment as typically found in
|
||||
# /opt/tljh/user, is setup with these packages.
|
||||
# /opt/tljh/user, is installed with these packages.
|
||||
#
|
||||
# Whats listed here represents additional packages that the distributions
|
||||
# installs initially, but doesn't upgrade as tljh is upgraded.
|
||||
#
|
||||
# WARNING: The order of these dependencies matters, this was observed when using
|
||||
# the requirements-txt-fixer pre-commit hook that sorted them and made
|
||||
# our integration tests fail.
|
||||
#
|
||||
# JupyterHub + notebook package are base requirements for user environment
|
||||
jupyterhub==4.*
|
||||
notebook==6.*
|
||||
# Install additional notebook frontends!
|
||||
jupyterlab==3.*
|
||||
# nbgitpuller for easily pulling in Git repositories
|
||||
nbgitpuller==1.*
|
||||
7
tljh/requirements-user-env.txt
Normal file
7
tljh/requirements-user-env.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
# 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.*
|
||||
Reference in New Issue
Block a user