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 43b1a48
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions bin/steps/conda_compile
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# 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`
# conda accepts just python 2 or 3
PYTHON_VERSION_MAJOR_NUMBER=`echo $PYTHON_VERSION_NUMBER | cut -d \. -f 1`

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 anaconda
source activate condaenv

conda install pip --yes | indent
fi


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

Expand Down

0 comments on commit 43b1a48

Please sign in to comment.