Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert Mamba2 - Make it easier to update #721

Merged
merged 4 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Miniforge3/construct.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% 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:
{% set version = os.environ.get("MINIFORGE_VERSION", "24.11.3-0") %}
{% set conda_libmamba_solver_version = "24.9.0"%}
# This file is parsed by the scripts to define
# - `MICROMAMBA_VERSION` in `scripts/build.sh`
# - `MAMBA_VERSION` in `scripts/test.sh`
{% set mamba_version = "2.0.6" %}
{% set mamba_version = "1.5.12" %}

name: Miniforge3
version: {{ version }}
Expand Down
3 changes: 2 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ cp LICENSE "${TEMP_DIR}/"
ls -al "${TEMP_DIR}"

if [[ "${TARGET_PLATFORM}" != win-* ]]; then
MICROMAMBA_VERSION=2.0.6
# Assumes specific structure in construct.yaml
MICROMAMBA_VERSION=$(grep "set mamba_version" Miniforge3/construct.yaml | cut -d '=' -f 2 | cut -d '"' -f 2)
MICROMAMBA_BUILD=0
mkdir "${TEMP_DIR}/micromamba"
pushd "${TEMP_DIR}/micromamba"
Expand Down
65 changes: 2 additions & 63 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set -ex
echo "***** Start: Testing Miniforge installer *****"

export CONDA_PATH="${HOME}/miniforge"
export MAMBA_VERSION="${MAMBA_VERSION:-2.0.6}"
MAMBA_VERSION=$(grep "set mamba_version" Miniforge3/construct.yaml | cut -d '=' -f 2 | cut -d '"' -f 2)
export MAMBA_VERSION

CONSTRUCT_ROOT="${CONSTRUCT_ROOT:-${PWD}}"

Expand Down Expand Up @@ -73,28 +74,6 @@ 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"
Expand All @@ -107,43 +86,3 @@ 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 *****"

Loading