Skip to content

Commit 65a36cc

Browse files
committed
PR review comments: update micromamba, use MAMBA_EXE environment variable
1 parent 374efff commit 65a36cc

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

repo2docker/buildpacks/conda/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ def get_env_scripts(self):
339339
"${NB_USER}",
340340
r"""
341341
TIMEFORMAT='time: %3R' \
342-
bash -c 'time /tmp/bin/micromamba install -p {0} -f "{1}" && \
343-
# time /tmp/bin/micromamba clean --all -y && \
344-
/tmp/bin/micromamba list -p {0} \
342+
bash -c 'time ${{MAMBA_EXE}} install -p {0} -f "{1}" && \
343+
# time ${{MAMBA_EXE}} clean --all -y && \
344+
${{MAMBA_EXE}} list -p {0} \
345345
'
346346
""".format(
347347
env_prefix, environment_yml
@@ -358,9 +358,9 @@ def get_env_scripts(self):
358358
(
359359
"${NB_USER}",
360360
r"""
361-
/tmp/bin/micromamba install -p {0} r-base{1} r-irkernel={2} r-devtools -y && \
362-
# /tmp/bin/micromamba clean --all -f -y && \
363-
/tmp/bin/micromamba list -p {0}
361+
${{MAMBA_EXE}} install -p {0} r-base{1} r-irkernel=1.2 r-devtools -y && \
362+
# ${{MAMBA_EXE}} clean --all -f -y && \
363+
${{MAMBA_EXE}} list -p {0}
364364
""".format(
365365
env_prefix, r_pin
366366
),

repo2docker/buildpacks/conda/install-base-env.bash

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
# and sets up the base environment
44
set -ex
55

6-
76
cd $(dirname $0)
87

9-
URL="https://anaconda.org/conda-forge/micromamba/0.17.0/download/linux-64/micromamba-0.17.0-0.tar.bz2"
8+
export MAMBA_VERSION=0.19.1
9+
export CONDA_VERSION=4.11.0
10+
11+
URL="https://anaconda.org/conda-forge/micromamba/${MAMBA_VERSION}/download/linux-64/micromamba-${MAMBA_VERSION}-0.tar.bz2"
1012

1113
# make sure we don't do anything funky with user's $HOME
1214
# since this is run as root
@@ -35,7 +37,7 @@ update_dependencies: false
3537
# channel_priority: flexible
3638
EOT
3739

38-
micromamba install conda mamba -y
40+
micromamba install conda=${CONDA_VERSION} mamba=${MAMBA_VERSION} -y
3941

4042
echo "installing notebook env:"
4143
cat "${NB_ENVIRONMENT_FILE}"

tests/conda/binder-dir/verify

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ from subprocess import check_output
55
assert sys.version_info[:2] == (3, 5), sys.version
66

77
out = check_output(["/tmp/bin/micromamba", "--version"]).decode("utf8").strip()
8-
assert out == "0.17.0", out
8+
assert (
9+
out
10+
== """micromamba: 0.19.1
11+
libmamba: 0.19.1"""
12+
), out
13+
14+
out = check_output(["mamba", "--version"]).decode("utf8").strip()
15+
assert (
16+
out
17+
== """mamba 0.19.1
18+
conda 4.11.0"""
19+
), out
920

1021
import numpy

tests/conda/default-env/postBuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22
# install pytest with conda in the default env (should be $KERNEL_PYTHON_PREFIX)
3-
/tmp/bin/micromamba install -yq pytest -p $KERNEL_PYTHON_PREFIX
3+
conda install -yq pytest
44
# install there with pip (should be the same)
55
pip install there

0 commit comments

Comments
 (0)