Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Dec 12, 2024
1 parent 8862732 commit bc6b9c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 3 additions & 1 deletion repo2docker/buildpacks/conda/activate-conda.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# enable conda and activate the notebook environment
eval $(micromamba shell hook -s posix -p ${CONDA_DIR})
set -ex
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
if [[ "${KERNEL_PYTHON_PREFIX}" != "${NB_PYTHON_PREFIX}" ]]; then
Expand Down
12 changes: 8 additions & 4 deletions repo2docker/buildpacks/conda/install-base-env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -ex

cd $(dirname $0)

export MAMBA_VERSION=1.5.9
export CONDA_VERSION=24.5.0
export MAMBA_VERSION="2.0.5.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 All @@ -21,7 +21,7 @@ time wget -qO- ${URL} | tar -xvj bin/micromamba
mv bin/micromamba "$MICROMAMBA_EXE"
chmod 0755 "$MICROMAMBA_EXE"

eval "$(${MICROMAMBA_EXE} shell hook -p ${CONDA_DIR} -s posix)"
eval "$(${MICROMAMBA_EXE} shell hook --root-prefix ${CONDA_DIR} -s posix)"

micromamba activate

Expand All @@ -36,7 +36,11 @@ 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
9 changes: 3 additions & 6 deletions tests/conda/py35-binder-dir/verify
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ v = out.split()[1]
assert v[:3] == "3.5", out

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

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


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

0 comments on commit bc6b9c2

Please sign in to comment.