Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Switching to Python 3.6 by default #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Conda Environment Buildpack
===========================

Update (Aug-21, 2017): Updated the origin conda-buildpack to use Python 3.6 by default.


This is the [Heroku Buildpack][] for [Conda][] using it's new
[environment spec][]. Anything you can install with `conda install` can be
installed using this, including the entire data science stack. Be careful of
Expand Down
4 changes: 2 additions & 2 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ done

# Set context environment variables.
set-env PATH '$HOME/.heroku/miniconda/bin:$PATH'
PYTHONPATH='/app/.heroku/miniconda/lib/python2.7/site-packages:$PYTHONPATH'
PYTHONPATH='/app/.heroku/miniconda/lib/python3.6/site-packages:$PYTHONPATH'
if [ -f environment.yml ]; then
PYTHONPATH="/app/.heroku/miniconda/envs/heroku-env/lib/python2.7/site-packages:${PYTHONPATH}"
PYTHONPATH="/app/.heroku/miniconda/envs/heroku-env/lib/python3.6/site-packages:${PYTHONPATH}"
set-default-env CONDA_DEFAULT_ENV "heroku-env"
fi
set-default-env PYTHONPATH $PYTHONPATH
Expand Down
19 changes: 11 additions & 8 deletions bin/steps/conda_compile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
#!/usr/bin/env bash
CONDA_VERSION=3.8.3
CONDA_VERSION=latest
if [ ! -d /app/.heroku/miniconda ]; then
puts-step "Preparing Python/Miniconda Environment (${CONDA_VERSION})"
curl -Os http://repo.continuum.io/miniconda/Miniconda-${CONDA_VERSION}-Linux-x86_64.sh
bash Miniconda-${CONDA_VERSION}-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent
rm -fr Miniconda-${CONDA_VERSION}-Linux-x86_64.sh
puts-step "Preparing Python/Miniconda3 Environment (${CONDA_VERSION})"
curl -Os http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh
bash Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -p /app/.heroku/miniconda/ -b | indent
rm -fr Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh

conda update conda --quiet --yes | indent
fi


if [ -f conda-requirements.txt ]; then
puts-step "Installing dependencies using Conda"
puts-step "Installing dependencies using Conda3"
conda install --file conda-requirements.txt --yes
fi

if [ -f environment.yml ]; then
puts-step "Creating conda environment"
# TODO: Use update if its already there
conda env remove --yes --quiet --name heroku-env
# Remove existing environment if it already exists
if conda env list | grep "heroku-env" > /dev/null
then
conda env remove --yes --quiet --name heroku-env
fi
conda env create --name=heroku-env --file environment.yml
fi

Expand Down