Skip to content

Commit

Permalink
test: Use 2.0.7.rc0
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <[email protected]>
  • Loading branch information
jjerphan committed Feb 25, 2025
1 parent 17a23c4 commit 42df755
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
29 changes: 21 additions & 8 deletions repo2docker/buildpacks/conda/activate-conda.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# enable conda and activate the notebook environment
set -e
set -ex

# Setup conda
CONDA_PROFILE="${CONDA_DIR}/etc/profile.d/conda.sh"
echo "Activating profile: ${CONDA_PROFILE}"
test -f $CONDA_PROFILE && . $CONDA_PROFILE

# Setup micromamba
eval $(micromamba shell hook -s posix -r ${CONDA_DIR})
for name in conda mamba; do
CONDA_PROFILE="${CONDA_DIR}/etc/profile.d/${name}.sh"
echo "Activating profile: ${CONDA_PROFILE}"
test -f $CONDA_PROFILE && . $CONDA_PROFILE
done

# Setup mamba
export MAMBA_ROOT_PREFIX="${CONDA_DIR}"
__mamba_setup="$("${CONDA_DIR}/bin/mamba" shell hook --shell posix 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias mamba="${CONDA_DIR}/bin/mamba" # Fallback on help from mamba activate
fi
unset __mamba_setup

# Activate the environment
if [[ "${KERNEL_PYTHON_PREFIX}" != "${NB_PYTHON_PREFIX}" ]]; then
# if the kernel is a separate env, stack them
# so both are on PATH, notebook first
Expand All @@ -22,4 +35,4 @@ else
mamba activate ${NB_PYTHON_PREFIX}
fi

set +e
set +ex
7 changes: 5 additions & 2 deletions repo2docker/buildpacks/conda/install-base-env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -ex

cd $(dirname $0)

export MAMBA_VERSION="2.0.5"
export MAMBA_VERSION="2.0.7.rc0"
export CONDA_VERSION=24.11.0

URL="https://anaconda.org/conda-forge/micromamba/${MAMBA_VERSION}/download/${CONDA_PLATFORM}/micromamba-${MAMBA_VERSION}-0.tar.bz2"
Expand Down Expand Up @@ -36,7 +36,10 @@ update_dependencies: false
# channel_priority: flexible
EOT

micromamba install conda=${CONDA_VERSION} mamba=${MAMBA_VERSION} -y
micromamba install \
-c conda-forge/label/mamba_prerelease \
-c conda-forge \
conda=${CONDA_VERSION} mamba=${MAMBA_VERSION} -y

echo "installing notebook env:"
cat "${NB_ENVIRONMENT_FILE}"
Expand Down
4 changes: 2 additions & 2 deletions tests/conda/py35-binder-dir/verify
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ v = out.split()[1]
assert v[:3] == "3.5", out

out = sh(["micromamba", "--version"])
assert out == "2.0.5", out
assert out == "2.0.7.rc0", out

out = sh(["mamba", "--version"])
assert out == "2.0.5", out
assert out == "2.0.7.rc0", out


sh([kernel_python, "-c", "import numpy"])

0 comments on commit 42df755

Please sign in to comment.