From 67b113b2542b7a77817d5b613d41ad1e28645bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dra=C5=BEen=20Lu=C4=8Danin?= Date: Tue, 7 Apr 2015 18:07:52 +0200 Subject: [PATCH] python runtime support, fixes #8 --- bin/steps/conda_compile | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/bin/steps/conda_compile b/bin/steps/conda_compile index f77bdb46..defeb4d4 100755 --- a/bin/steps/conda_compile +++ b/bin/steps/conda_compile @@ -1,8 +1,22 @@ +# 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 @@ -10,6 +24,7 @@ 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