diff --git a/Miniforge3/construct.yaml b/Miniforge3/construct.yaml index 18a162da..31c6e9ea 100644 --- a/Miniforge3/construct.yaml +++ b/Miniforge3/construct.yaml @@ -1,9 +1,9 @@ -{% set version = os.environ.get("MINIFORGE_VERSION", "24.11.3-0") %} -{% set conda_libmamba_solver_version = "24.9.0"%} -# when mamba_version is updated here, also update MICROMAMBA_VERSION in scripts/build.sh -# As of Dec 2024 -- mamba 2.0.5 isn't compatible with constructor -# https://github.com/conda-forge/miniforge/issues/697 -{% set mamba_version = "1.5.12" %} +{% set version = os.environ.get("MINIFORGE_VERSION", "25.1.1-0") %} +{% set conda_libmamba_solver_version = "25.1.1"%} +# When `mamba_version` is updated here, also update the value of: +# - `MICROMAMBA_VERSION` in `scripts/build.sh` +# - `MAMBA_VERSION` in `scripts/test.sh` +{% set mamba_version = "2.0.6" %} name: Miniforge3 version: {{ version }} diff --git a/scripts/build.sh b/scripts/build.sh index 9a2129b1..aac085a4 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -14,7 +14,7 @@ echo "***** Install constructor *****" mamba install --yes \ --channel conda-forge --override-channels \ jinja2 curl libarchive \ - "constructor>=3.9.3" + "constructor>=3.11.1" if [[ "$(uname)" == "Darwin" ]]; then mamba install --yes \ @@ -38,7 +38,7 @@ cp LICENSE "${TEMP_DIR}/" ls -al "${TEMP_DIR}" if [[ "${TARGET_PLATFORM}" != win-* ]]; then - MICROMAMBA_VERSION=1.5.11 + MICROMAMBA_VERSION=2.0.6 MICROMAMBA_BUILD=0 mkdir "${TEMP_DIR}/micromamba" pushd "${TEMP_DIR}/micromamba" diff --git a/scripts/test.sh b/scripts/test.sh index cd593b1a..089f27de 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -5,6 +5,7 @@ set -ex echo "***** Start: Testing Miniforge installer *****" export CONDA_PATH="${HOME}/miniforge" +export MAMBA_VERSION="${MAMBA_VERSION:-2.0.6}" CONSTRUCT_ROOT="${CONSTRUCT_ROOT:-${PWD}}" @@ -72,6 +73,28 @@ EOF conda list fi +echo "+ Mamba does not warn (check that there is no warning on stderr) and returns exit code 0" +mamba --help 2> stderr.log || cat stderr.log +test ! -s stderr.log +rm -f stderr.log + +echo "+ mamba info" +mamba info + +echo "+ mamba config sources" +mamba config sources + +echo "+ mamba config list" +mamba config list + +echo "+ Testing mamba version (i.e. ${MAMBA_VERSION})" +mamba info --json | python -c "import sys, json; info = json.loads(sys.stdin.read()); assert info['mamba version'] == '${MAMBA_VERSION}', info" +echo " OK" + +echo "+ Testing mamba channels" +mamba info --json | python -c "import sys, json; info = json.loads(sys.stdin.read()); assert any('conda-forge' in c for c in info['channels']), info" +echo " OK" + echo "***** Python path *****" python -c "import sys; print(sys.executable)" python -c "import sys; assert 'miniforge' in sys.executable" @@ -84,3 +107,43 @@ python -c "import platform; print(platform.machine())" python -c "import platform; print(platform.release())" echo "***** Done: Testing installer *****" + +echo "***** Testing the usage of mamba main commands *****" + +echo "***** Initialize the current session for mamba *****" +eval "$(mamba shell hook --shell bash)" + +echo "***** Create a new environment *****" +ENV_PREFIX="/tmp/testenv" + +mamba create -p $ENV_PREFIX numpy --yes -vvv + +echo "***** Activate the environment with mamba *****" +mamba activate $ENV_PREFIX + +echo "***** Check that numpy is installed with mamba list *****" +mamba list | grep numpy + +echo "***** Deactivate the environment *****" +mamba deactivate + +echo "***** Activate the environment with conda *****" +conda activate $ENV_PREFIX + +echo "***** Check that numpy is installed with python *****" +python -c "import numpy; print(numpy.__version__)" + +echo "***** Remove numpy *****" +mamba remove numpy --yes + +echo "***** Check that numpy is not installed with mamba list *****" +mamba list | grep -v numpy + +echo "***** Deactivate the environment with conda *****" +conda deactivate + +echo "***** Remove the environment *****" +mamba env remove -p $ENV_PREFIX --yes + +echo "***** Done: Testing mamba main commands *****" +