File tree Expand file tree Collapse file tree 3 files changed +28
-12
lines changed
repo2docker/buildpacks/conda
tests/conda/py35-binder-dir Expand file tree Collapse file tree 3 files changed +28
-12
lines changed Original file line number Diff line number Diff line change 1
- # enable conda and activate the notebook environment
2
- set -e
1
+ set -ex
2
+
3
+ # Setup conda
4
+ CONDA_PROFILE=" ${CONDA_DIR} /etc/profile.d/conda.sh"
5
+ echo " Activating profile: ${CONDA_PROFILE} "
6
+ test -f $CONDA_PROFILE && . $CONDA_PROFILE
7
+
8
+ # Setup micromamba
3
9
eval $( micromamba shell hook -s posix -r ${CONDA_DIR} )
4
- for name in conda mamba; do
5
- CONDA_PROFILE=" ${CONDA_DIR} /etc/profile.d/${name} .sh"
6
- echo " Activating profile: ${CONDA_PROFILE} "
7
- test -f $CONDA_PROFILE && . $CONDA_PROFILE
8
- done
10
+
11
+ # Setup mamba
12
+ export MAMBA_ROOT_PREFIX=" ${CONDA_DIR} "
13
+ __mamba_setup=" $( " ${CONDA_DIR} /bin/mamba" shell hook --shell posix 2> /dev/null) "
14
+ if [ $? -eq 0 ]; then
15
+ eval " $__mamba_setup "
16
+ else
17
+ alias mamba=" ${CONDA_DIR} /bin/mamba" # Fallback on help from mamba activate
18
+ fi
19
+ unset __mamba_setup
20
+
21
+ # Activate the environment
9
22
if [[ " ${KERNEL_PYTHON_PREFIX} " != " ${NB_PYTHON_PREFIX} " ]]; then
10
23
# if the kernel is a separate env, stack them
11
24
# so both are on PATH, notebook first
22
35
mamba activate ${NB_PYTHON_PREFIX}
23
36
fi
24
37
25
- set +e
38
+ set +ex
Original file line number Diff line number Diff line change 5
5
6
6
cd $( dirname $0 )
7
7
8
- export MAMBA_VERSION=" 2.0.5 "
8
+ export MAMBA_VERSION=" 2.0.7.rc0 "
9
9
export CONDA_VERSION=24.11.0
10
10
11
11
URL=" https://anaconda.org/conda-forge/micromamba/${MAMBA_VERSION} /download/${CONDA_PLATFORM} /micromamba-${MAMBA_VERSION} -0.tar.bz2"
@@ -36,7 +36,10 @@ update_dependencies: false
36
36
# channel_priority: flexible
37
37
EOT
38
38
39
- micromamba install conda=${CONDA_VERSION} mamba=${MAMBA_VERSION} -y
39
+ micromamba install \
40
+ -c conda-forge/label/mamba_prerelease \
41
+ -c conda-forge \
42
+ conda=${CONDA_VERSION} mamba=${MAMBA_VERSION} -y
40
43
41
44
echo " installing notebook env:"
42
45
cat " ${NB_ENVIRONMENT_FILE} "
Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ v = out.split()[1]
16
16
assert v [:3 ] == "3.5" , out
17
17
18
18
out = sh (["micromamba" , "--version" ])
19
- assert out == "2.0.5 " , out
19
+ assert out == "2.0.7.rc0 " , out
20
20
21
21
out = sh (["mamba" , "--version" ])
22
- assert out == "2.0.5 " , out
22
+ assert out == "2.0.7.rc0 " , out
23
23
24
24
25
25
sh ([kernel_python , "-c" , "import numpy" ])
You can’t perform that action at this time.
0 commit comments