Skip to content

Commit

Permalink
Test last micromamba pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed Dec 11, 2024
1 parent 8862732 commit fb20775
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion repo2docker/buildpacks/conda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_build_env(self):
("MAMBA_ROOT_PREFIX", "${CONDA_DIR}"),
# this exe should be used for installs after bootstrap with micromamba
# switch this to /usr/local/bin/micromamba to use it for all installs
("MAMBA_EXE", "${CONDA_DIR}/bin/mamba"),
("MAMBA_EXE", "/usr/local/bin/micromamba"),
("CONDA_PLATFORM", self._conda_platform()),
]
if self._nb_requirements_file:
Expand Down
10 changes: 5 additions & 5 deletions repo2docker/buildpacks/conda/activate-conda.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# enable conda and activate the notebook environment
eval $(micromamba shell hook -s posix -p ${CONDA_DIR})
for name in conda mamba; do
eval $(micromamba shell hook -s posix -r ${CONDA_DIR})
for name in conda; do
CONDA_PROFILE="${CONDA_DIR}/etc/profile.d/${name}.sh"
test -f $CONDA_PROFILE && . $CONDA_PROFILE
done
if [[ "${KERNEL_PYTHON_PREFIX}" != "${NB_PYTHON_PREFIX}" ]]; then
# if the kernel is a separate env, stack them
# so both are on PATH, notebook first
mamba activate ${KERNEL_PYTHON_PREFIX}
mamba activate --stack ${NB_PYTHON_PREFIX}
micromamba activate ${KERNEL_PYTHON_PREFIX}
micromamba activate --stack ${NB_PYTHON_PREFIX}

# even though it's second on $PATH
# make sure CONDA_DEFAULT_ENV is the *kernel* env
Expand All @@ -17,5 +17,5 @@ if [[ "${KERNEL_PYTHON_PREFIX}" != "${NB_PYTHON_PREFIX}" ]]; then
# which only contains UI when the two are different
export CONDA_DEFAULT_ENV="${KERNEL_PYTHON_PREFIX}"
else
mamba activate ${NB_PYTHON_PREFIX}
micromamba activate ${NB_PYTHON_PREFIX}
fi
6 changes: 3 additions & 3 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 -r ${CONDA_DIR} -s posix)"

micromamba activate

Expand Down
18 changes: 9 additions & 9 deletions tests/conda/py35-binder-dir/verify
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ out = sh([kernel_python, "--version"], stderr=STDOUT)
v = out.split()[1]
assert v[:3] == "3.5", out

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

out = sh(["mamba", "--version"])
assert (
out
== """mamba 1.5.9
conda 24.5.0"""
), out
# out = sh(["micromamba", "--version"])
# assert out == "1.5.9", out

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

sh([kernel_python, "-c", "import numpy"])
2 changes: 1 addition & 1 deletion tests/conda/py36-postBuild/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -ex

# mamba/conda installs in kernel env
mamba install -y make
micromamba install -y make

# note `pip` on path is _not_ the kernel env!
# is this what we (or users) want?
Expand Down

0 comments on commit fb20775

Please sign in to comment.