Skip to content

Commit

Permalink
Add scripts to setup and teardown the miniconda version
Browse files Browse the repository at this point in the history
This should avoid weird issues caused by bitrotted miniconda versions
similar to
e-mission/e-mission-docs#511
or
e-mission/e-mission-docs#513

If such bitrotting happens, we need to upgrade the packages, but at least we
will know that we need to, and people won't have unpleasant surprises when they
try to install manually. Apparently, some people prefer to install manually
e-mission/e-mission-docs#513
  • Loading branch information
shankari committed Apr 16, 2020
1 parent 8095b85 commit f614b4a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ language: generic
install:
# We do this conditionally because it saves us some downloading if the
# version is the same.
- wget https://repo.continuum.io/miniconda/Miniconda3-4.5.12-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- source "$HOME/miniconda/etc/profile.d/conda.sh"
- hash -r
- conda config --set always_yes yes --set changeps1 no
# Useful for debugging any issues with conda
- conda info -a
- source setup/setup_conda.sh
services:
- mongodb
script:
Expand Down
11 changes: 10 additions & 1 deletion setup/setup.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@

# If the conda binary is not found, specify the full path to it
# you can find it by searching for "conda" under the miniconda3 directory
# typical paths are:
# - on linux: /home/<user>/miniconda3/bin/conda
# - on OSX: /Users/<user>/miniconda3/bin/conda
# - on Windows: C:/Users/<user>/Miniconda3/Scripts/conda

CURR_CONDA_VER=`conda --version | cut -d " " -f 2`
EXP_CONDA_VER=4.5.12

if [ $CURR_CONDA_VER == $EXP_CONDA_VER ]; then
echo "For conda, found $CURR_CONDA_VER, expected $EXP_CONDA_VER, all is good!"
else
echo "For conda, found $CURR_CONDA_VER, expected $EXP_CONDA_VER, run setup/setup_conda.sh to get the correct version"
exit 1
fi

echo "Setting up blank environment"
conda create --name emission python=3.6
source activate emission
Expand Down
9 changes: 9 additions & 0 deletions setup/setup_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
EXP_CONDA_VER=4.5.12

wget https://repo.continuum.io/miniconda/Miniconda3-$EXP_CONDA_VER-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda
source "$HOME/miniconda/etc/profile.d/conda.sh"
hash -r
conda config --set always_yes yes --set changeps1 no
# Useful for debugging any issues with conda
conda info -a
1 change: 1 addition & 0 deletions setup/teardown_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rm -rf $HOME/miniconda

0 comments on commit f614b4a

Please sign in to comment.