Skip to content

Commit 8348d4a

Browse files
authored
Merge pull request #968 from consideRatio/pr/fix-tests
Re-install conda/mamba for every tljh upgrade (doesn't imply upgrade)
2 parents 579b7eb + 4e397bc commit 8348d4a

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

.github/integration-test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,23 @@ def run_test(
167167
command = f"python3 /srv/src/bootstrap/bootstrap.py --version={upgrade_from}"
168168
run_command(container_name, command)
169169

170+
# show user environment
171+
command = "/opt/tljh/user/bin/mamba list"
172+
run_command(container_name, command)
173+
170174
command = f"python3 /srv/src/bootstrap/bootstrap.py {' '.join(installer_args)}"
171175
run_command(container_name, command)
172176

177+
# show user environment (again if upgrade)
178+
command = "/opt/tljh/user/bin/mamba list"
179+
run_command(container_name, command)
180+
173181
# Install pkgs from requirements in hub's pip, where
174182
# the bootstrap script installed the others
175183
command = "/opt/tljh/hub/bin/python3 -m pip install -r /srv/src/integration-tests/requirements.txt"
176184
run_command(container_name, command)
177185

178-
# show environment
186+
# show hub environment
179187
command = "/opt/tljh/hub/bin/python3 -m pip freeze"
180188
run_command(container_name, command)
181189

integration-tests/plugins/simplest/tljh_simplest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def tljh_extra_user_conda_packages():
1212

1313
@hookimpl
1414
def tljh_extra_user_pip_packages():
15-
return ["django"]
15+
return ["simplejson"]
1616

1717

1818
@hookimpl

integration-tests/test_simplest_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_tljh_extra_user_conda_packages():
2020

2121

2222
def test_tljh_extra_user_pip_packages():
23-
subprocess.check_call([f"{USER_ENV_PREFIX}/bin/python3", "-c", "import django"])
23+
subprocess.check_call([f"{USER_ENV_PREFIX}/bin/python3", "-c", "import simplejson"])
2424

2525

2626
def test_tljh_extra_hub_pip_packages():

tljh/installer.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,10 @@ def ensure_user_environment(user_requirements_txt_file):
242242
)
243243
to_upgrade.append(pkg)
244244

245-
# force reinstall conda/mamba to ensure a basically consistent env
246-
# avoids issues with RemoveError: 'requests' is a dependency of conda
247-
# only do this for 'old' conda versions known to have a problem
248-
# we don't know how old, but we know 4.10 is affected and 23.1 is not
249-
if not is_fresh_install and V(package_versions.get("conda", "0")) < V("23.1"):
245+
# force reinstall conda/mamba to ensure conda doesn't raise error
246+
# "RemoveError: 'requests' is a dependency of conda" later on when
247+
# conda/mamba is used to install/upgrade something
248+
if not is_fresh_install:
250249
# force-reinstall doesn't upgrade packages
251250
# it reinstalls them in-place
252251
# only reinstall packages already present

0 commit comments

Comments
 (0)