diff --git a/MANIFEST.in b/MANIFEST.in index 4b590a3..50c1cf7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include tljh/systemd-units/* include tljh/*.tpl -include tljh/requirements-base.txt +include tljh/requirements-*.txt diff --git a/tljh/installer.py b/tljh/installer.py index 755326e..0054ab9 100644 --- a/tljh/installer.py +++ b/tljh/installer.py @@ -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 diff --git a/tljh/requirements-base.txt b/tljh/requirements-user-env-extras.txt similarity index 74% rename from tljh/requirements-base.txt rename to tljh/requirements-user-env-extras.txt index f926a5a..7f27c70 100644 --- a/tljh/requirements-base.txt +++ b/tljh/requirements-user-env-extras.txt @@ -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.* diff --git a/tljh/requirements-user-env.txt b/tljh/requirements-user-env.txt new file mode 100644 index 0000000..a9528e9 --- /dev/null +++ b/tljh/requirements-user-env.txt @@ -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.*