|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +home_dir=$(pwd) |
| 4 | +echo "[home_dir: $home_dir]" |
| 5 | + |
| 6 | +echo "[ls -ltr]" |
| 7 | +ls -ltr |
| 8 | + |
| 9 | +echo "[Using clean Miniconda install]" |
| 10 | +rm -rf "$MINICONDA_DIR" |
| 11 | + |
| 12 | +# install miniconda |
| 13 | +wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q -O miniconda.sh || exit 1 |
| 14 | +bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1 |
| 15 | + |
| 16 | +export PATH="$MINICONDA_DIR/bin:$PATH" |
| 17 | + |
| 18 | +echo "[update conda]" |
| 19 | +conda config --set ssl_verify false || exit 1 |
| 20 | +conda config --set always_yes true --set changeps1 false || exit 1 |
| 21 | +conda update -q conda |
| 22 | + |
| 23 | +# add the pandas channel to take priority |
| 24 | +# to add extra packages |
| 25 | +echo "[add channels]" |
| 26 | +conda config --add channels pandas || exit 1 |
| 27 | +conda config --remove channels defaults || exit 1 |
| 28 | +conda config --add channels defaults || exit 1 |
| 29 | + |
| 30 | +# Useful for debugging any issues with conda |
| 31 | +conda info -a || exit 1 |
| 32 | + |
| 33 | +# support env variables passed |
| 34 | +export ENVS_FILE=".envs" |
| 35 | + |
| 36 | +# make sure that the .envs file exists. it is ok if it is empty |
| 37 | +touch $ENVS_FILE |
| 38 | + |
| 39 | +# assume all command line arguments are environmental variables |
| 40 | +for var in "$@" |
| 41 | +do |
| 42 | + echo "export $var" >> $ENVS_FILE |
| 43 | +done |
| 44 | + |
| 45 | +echo "[environmental variable file]" |
| 46 | +cat $ENVS_FILE |
| 47 | +source $ENVS_FILE |
| 48 | + |
| 49 | +export REQ_BUILD=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.build |
| 50 | +export REQ_RUN=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.run |
| 51 | +export REQ_PIP=ci/requirements-${PYTHON_VERSION}${JOB_TAG}.pip |
| 52 | + |
| 53 | +# edit the locale override if needed |
| 54 | +if [ -n "$LOCALE_OVERRIDE" ]; then |
| 55 | + echo "[Adding locale to the first line of pandas/__init__.py]" |
| 56 | + rm -f pandas/__init__.pyc |
| 57 | + sedc="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LOCALE_OVERRIDE')\n" |
| 58 | + sed -i "$sedc" pandas/__init__.py |
| 59 | + echo "[head -4 pandas/__init__.py]" |
| 60 | + head -4 pandas/__init__.py |
| 61 | + echo |
| 62 | +fi |
| 63 | + |
| 64 | +# create new env |
| 65 | +echo "[create env]" |
| 66 | +time conda create -q -n pandas python=${PYTHON_VERSION} pytest || exit 1 |
| 67 | + |
| 68 | +source activate pandas |
| 69 | + |
| 70 | +# build deps |
| 71 | +echo "[build installs: ${REQ_BUILD}]" |
| 72 | +time conda install -q --file=${REQ_BUILD} || exit 1 |
| 73 | + |
| 74 | +# build but don't install |
| 75 | +echo "[build em]" |
| 76 | +time python setup.py build_ext --inplace || exit 1 |
| 77 | + |
| 78 | +# we may have run installations |
| 79 | +echo "[conda installs: ${REQ_RUN}]" |
| 80 | +if [ -e ${REQ_RUN} ]; then |
| 81 | + time conda install -q --file=${REQ_RUN} || exit 1 |
| 82 | +fi |
| 83 | + |
| 84 | +# we may have additional pip installs |
| 85 | +echo "[pip installs: ${REQ_PIP}]" |
| 86 | +if [ -e ${REQ_PIP} ]; then |
| 87 | + pip install -q -r $REQ_PIP |
| 88 | +fi |
0 commit comments