mirror of
https://github.com/jupyterhub/the-littlest-jupyterhub.git
synced 2025-12-18 21:54:05 +08:00
Merge pull request #968 from consideRatio/pr/fix-tests
Re-install conda/mamba for every tljh upgrade (doesn't imply upgrade)
This commit is contained in:
10
.github/integration-test.py
vendored
10
.github/integration-test.py
vendored
@@ -167,15 +167,23 @@ def run_test(
|
|||||||
command = f"python3 /srv/src/bootstrap/bootstrap.py --version={upgrade_from}"
|
command = f"python3 /srv/src/bootstrap/bootstrap.py --version={upgrade_from}"
|
||||||
run_command(container_name, command)
|
run_command(container_name, command)
|
||||||
|
|
||||||
|
# show user environment
|
||||||
|
command = "/opt/tljh/user/bin/mamba list"
|
||||||
|
run_command(container_name, command)
|
||||||
|
|
||||||
command = f"python3 /srv/src/bootstrap/bootstrap.py {' '.join(installer_args)}"
|
command = f"python3 /srv/src/bootstrap/bootstrap.py {' '.join(installer_args)}"
|
||||||
run_command(container_name, command)
|
run_command(container_name, command)
|
||||||
|
|
||||||
|
# show user environment (again if upgrade)
|
||||||
|
command = "/opt/tljh/user/bin/mamba list"
|
||||||
|
run_command(container_name, command)
|
||||||
|
|
||||||
# Install pkgs from requirements in hub's pip, where
|
# Install pkgs from requirements in hub's pip, where
|
||||||
# the bootstrap script installed the others
|
# the bootstrap script installed the others
|
||||||
command = "/opt/tljh/hub/bin/python3 -m pip install -r /srv/src/integration-tests/requirements.txt"
|
command = "/opt/tljh/hub/bin/python3 -m pip install -r /srv/src/integration-tests/requirements.txt"
|
||||||
run_command(container_name, command)
|
run_command(container_name, command)
|
||||||
|
|
||||||
# show environment
|
# show hub environment
|
||||||
command = "/opt/tljh/hub/bin/python3 -m pip freeze"
|
command = "/opt/tljh/hub/bin/python3 -m pip freeze"
|
||||||
run_command(container_name, command)
|
run_command(container_name, command)
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ def tljh_extra_user_conda_packages():
|
|||||||
|
|
||||||
@hookimpl
|
@hookimpl
|
||||||
def tljh_extra_user_pip_packages():
|
def tljh_extra_user_pip_packages():
|
||||||
return ["django"]
|
return ["simplejson"]
|
||||||
|
|
||||||
|
|
||||||
@hookimpl
|
@hookimpl
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def test_tljh_extra_user_conda_packages():
|
|||||||
|
|
||||||
|
|
||||||
def test_tljh_extra_user_pip_packages():
|
def test_tljh_extra_user_pip_packages():
|
||||||
subprocess.check_call([f"{USER_ENV_PREFIX}/bin/python3", "-c", "import django"])
|
subprocess.check_call([f"{USER_ENV_PREFIX}/bin/python3", "-c", "import simplejson"])
|
||||||
|
|
||||||
|
|
||||||
def test_tljh_extra_hub_pip_packages():
|
def test_tljh_extra_hub_pip_packages():
|
||||||
|
|||||||
@@ -242,11 +242,10 @@ def ensure_user_environment(user_requirements_txt_file):
|
|||||||
)
|
)
|
||||||
to_upgrade.append(pkg)
|
to_upgrade.append(pkg)
|
||||||
|
|
||||||
# force reinstall conda/mamba to ensure a basically consistent env
|
# force reinstall conda/mamba to ensure conda doesn't raise error
|
||||||
# avoids issues with RemoveError: 'requests' is a dependency of conda
|
# "RemoveError: 'requests' is a dependency of conda" later on when
|
||||||
# only do this for 'old' conda versions known to have a problem
|
# conda/mamba is used to install/upgrade something
|
||||||
# we don't know how old, but we know 4.10 is affected and 23.1 is not
|
if not is_fresh_install:
|
||||||
if not is_fresh_install and V(package_versions.get("conda", "0")) < V("23.1"):
|
|
||||||
# force-reinstall doesn't upgrade packages
|
# force-reinstall doesn't upgrade packages
|
||||||
# it reinstalls them in-place
|
# it reinstalls them in-place
|
||||||
# only reinstall packages already present
|
# only reinstall packages already present
|
||||||
|
|||||||
Reference in New Issue
Block a user