From 44cf01496714f057c094d1e9bad304bf91fc1b17 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Thu, 23 Jul 2026 06:05:07 -0700 Subject: [PATCH] ensure that selected installer is used for uninstall step - fix #11 (likely also #14 and #15) - consistently use the selected installer (conda, mamba, micromamba) for the MDAnalysis uninstall step - only uninstall with a conda-based installer if pip was NOT selected as the installer --- action.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/action.yaml b/action.yaml index 3f71ea3..22adf56 100644 --- a/action.yaml +++ b/action.yaml @@ -58,13 +58,14 @@ runs: - name: Uninstall pre-existing versions shell: ${{ inputs.shell }} run: | - # uninstall tests even if not reinstalling, - # as versions can clash + # uninstall tests even if not reinstalling, as versions can clash # we may need to continuously re-uninstall if there are multiple versions # also, match ^MDAnalysis with space, to avoid matching stuff like MDAnalysisData - - conda remove --force mdanalysis --yes || true - conda remove --force mdanalysistests --yes || true + if [ "${{ inputs.installer }}" != "pip" ]; then + # clean-up a conda-based installation first + ${{ inputs.installer }} remove --force mdanalysis --yes || true + ${{ inputs.installer }} remove --force mdanalysistests --yes || true + fi while [[ $(python -m pip list | grep "^MDAnalysis ") ]] ; do python -m pip uninstall -y MDAnalysis MDAnalysisTests