Skip to content

Commit

Permalink
python runtime support, fixes heroku-python#8
Browse files Browse the repository at this point in the history
  • Loading branch information
metakermit committed Apr 9, 2015
1 parent de2c05a commit 67b113b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions bin/steps/conda_compile
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
# determine Python version
DEFAULT_PYTHON_VERSION="python-2.7.9"
# If no runtime given, assume default version.
if [ ! -f runtime.txt ]; then
echo $DEFAULT_PYTHON_VERSION > runtime.txt
fi
PYTHON_VERSION=$(cat runtime.txt)
# split on '-' and take just the number
PYTHON_VERSION_NUMBER=`echo $PYTHON_VERSION | cut -d \- -f 2`

if [ ! -d /app/.heroku/miniconda ]; then
puts-step "Preparing Python/Miniconda Environment (3.5.2)"
curl -Os http://repo.continuum.io/miniconda/Miniconda-3.7.3-Linux-x86_64.sh
bash Miniconda-3.7.3-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent
rm -fr Miniconda-3.7.3-Linux-x86_64.sh
puts-step "Preparing Python/Miniconda Environment"
curl -Os http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh
bash Miniconda-latest-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent
rm -fr Miniconda-latest-Linux-x86_64.sh

conda update --yes conda
conda create -n condaenv --yes python=$PYTHON_VERSION_NUMBER conda
source activate condaenv

conda install pip --yes | indent
fi


if [ -f conda-requirements.txt ]; then
puts-step "Installing dependencies using Conda"
source activate condaenv
conda install --file conda-requirements.txt --yes | indent
fi

Expand Down

0 comments on commit 67b113b

Please sign in to comment.