Re-install conda/mamba for every tljh upgrade (doesn't imply upgrade)

This commit is contained in:
Erik Sundell
2024-02-26 09:40:00 +01:00
parent 7d8a84860f
commit 4e397bc687

View File

@@ -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