reinstall conda/mamba in a separate, unconditional step

makes it more likely that subsequent conda installs will succeed

- fix indentation on the upgrade steps so they aren't run every iteration
- no longer need to bump required versions
This commit is contained in:
Min RK
2023-06-09 14:45:30 +02:00
parent 29b354b42b
commit ee23e041de
2 changed files with 34 additions and 21 deletions

View File

@@ -98,7 +98,7 @@ def install_miniconda(installer_path, prefix):
fix_permissions(prefix)
def ensure_conda_packages(prefix, packages, force=False):
def ensure_conda_packages(prefix, packages, force_reinstall=False):
"""
Ensure packages (from conda-forge) are installed in the conda prefix.
@@ -112,7 +112,7 @@ def ensure_conda_packages(prefix, packages, force=False):
cmd = [conda_executable, "install", "--yes"]
if force:
if force_reinstall:
# use force-reinstall, e.g. for conda/mamba to ensure everything is okay
# avoids problems with RemoveError upgrading conda from old versions
cmd += ["--force-reinstall"]