Skip to content

Commit 9766c95

Browse files
authored
Merge pull request #576 from minrk/pin-conda-more
pin conda during Python-switch step
2 parents e218a32 + 89027c6 commit 9766c95

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

repo2docker/buildpacks/conda/install-miniconda.bash

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ conda install -yq conda==${CONDA_VERSION}
3838
# prevent pip installation.
3939
# we wouldn't have this issue if we did `conda env create`
4040
# instead of `conda env update` in these cases
41-
conda install -y $(cat /tmp/environment.yml | grep -o '\spython=.*')
41+
conda install -y $(cat /tmp/environment.yml | grep -o '\spython=.*') conda==${CONDA_VERSION}
4242

4343
# bug in conda 4.3.>15 prevents --set update_dependencies
4444
echo 'update_dependencies: false' >> ${CONDA_DIR}/.condarc
@@ -57,16 +57,20 @@ if [[ -f /tmp/kernel-environment.yml ]]; then
5757

5858
conda env create -n kernel -f /tmp/kernel-environment.yml
5959
${CONDA_DIR}/envs/kernel/bin/ipython kernel install --prefix "${CONDA_DIR}"
60-
rm -f ${CONDA_DIR}/envs/kernel/conda-meta/history
60+
echo '' > ${CONDA_DIR}/envs/kernel/conda-meta/history
6161
fi
62-
# remove conda history file,
62+
# empty conda history file,
6363
# which seems to result in some effective pinning of packages in the initial env,
64-
# which we don't intend
65-
rm -f ${CONDA_DIR}/conda-meta/history
64+
# which we don't intend.
65+
# this file must not be *removed*, however
66+
echo '' > ${CONDA_DIR}/conda-meta/history
67+
6668
# Clean things out!
6769
conda clean -tipsy
6870

6971
# Remove the big installer so we don't increase docker image size too much
7072
rm ${INSTALLER_PATH}
7173

7274
chown -R $NB_USER:$NB_USER ${CONDA_DIR}
75+
76+
conda list

tests/conda/binder-dir/verify

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ import sys
44
assert sys.version_info[:2] == (3, 5), sys.version
55

66
import numpy
7+
import conda
8+
assert conda.__version__ == '4.5.11', conda.__version__

0 commit comments

Comments
 (0)