|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# There are 2 distinct pieces that get zipped and cached |
| 4 | +# - The venv site-packages dir including the installed dependencies |
| 5 | +# - The pandas build artifacts, using the build cache support via |
| 6 | +# scripts/use_build_cache.py |
| 7 | +# |
| 8 | +# if the user opted in to use the cache and we're on a whitelisted fork |
| 9 | +# - if the server doesn't hold a cached version of venv/pandas build, |
| 10 | +# do things the slow way, and put the results on the cache server |
| 11 | +# for the next time. |
| 12 | +# - if the cache files are available, instal some necessaries via apt |
| 13 | +# (no compiling needed), then directly goto script and collect 200$. |
| 14 | +# |
| 15 | + |
| 16 | +function edit_init() |
| 17 | +{ |
| 18 | + if [ -n "$LOCALE_OVERRIDE" ]; then |
| 19 | + echo "Adding locale to the first line of pandas/__init__.py" |
| 20 | + rm -f pandas/__init__.pyc |
| 21 | + sedc="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LOCALE_OVERRIDE')\n" |
| 22 | + sed -i "$sedc" pandas/__init__.py |
| 23 | + echo "head -4 pandas/__init__.py" |
| 24 | + head -4 pandas/__init__.py |
| 25 | + echo |
| 26 | + fi |
| 27 | +} |
| 28 | + |
| 29 | +edit_init |
| 30 | + |
| 31 | +python_major_version="${TRAVIS_PYTHON_VERSION:0:1}" |
| 32 | +[ "$python_major_version" == "2" ] && python_major_version="" |
| 33 | + |
| 34 | +home_dir=$(pwd) |
| 35 | +echo "home_dir: [$home_dir]" |
| 36 | + |
| 37 | +if [ -n "$LOCALE_OVERRIDE" ]; then |
| 38 | + # make sure the locale is available |
| 39 | + # probably useless, since you would need to relogin |
| 40 | + time sudo locale-gen "$LOCALE_OVERRIDE" |
| 41 | +fi |
| 42 | + |
| 43 | +# Need to enable for locale testing. The ___location of the locale file(s) is |
| 44 | +# distro specific. For example, on Arch Linux all of the locales are in a |
| 45 | +# commented file--/etc/locale.gen--that must be commented in to be used |
| 46 | +# whereas Ubuntu looks in /var/lib/locales/supported.d/* and generates locales |
| 47 | +# based on what's in the files in that folder |
| 48 | +time echo 'it_CH.UTF-8 UTF-8' | sudo tee -a /var/lib/locales/supported.d/it |
| 49 | +time sudo locale-gen |
| 50 | + |
| 51 | + |
| 52 | +# install gui for clipboard testing |
| 53 | +if [ -n "$CLIPBOARD_GUI" ]; then |
| 54 | + echo "Using CLIPBOARD_GUI: $CLIPBOARD_GUI" |
| 55 | + [ -n "$python_major_version" ] && py="py" |
| 56 | + python_cb_gui_pkg=python${python_major_version}-${py}${CLIPBOARD_GUI} |
| 57 | + time sudo apt-get $APT_ARGS install $python_cb_gui_pkg |
| 58 | +fi |
| 59 | + |
| 60 | + |
| 61 | +# install a clipboard if $CLIPBOARD is not empty |
| 62 | +if [ -n "$CLIPBOARD" ]; then |
| 63 | + echo "Using clipboard: $CLIPBOARD" |
| 64 | + time sudo apt-get $APT_ARGS install $CLIPBOARD |
| 65 | +fi |
| 66 | + |
| 67 | +python_major_version="${TRAVIS_PYTHON_VERSION:0:1}" |
| 68 | +[ "$python_major_version" == "2" ] && python_major_version="" |
| 69 | + |
| 70 | +wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh || exit 1 |
| 71 | +bash miniconda.sh -b -p $HOME/miniconda || exit 1 |
| 72 | + |
| 73 | +conda config --set always_yes yes --set changeps1 no || exit 1 |
| 74 | +conda update -q conda || exit 1 |
| 75 | +conda config --add channels http://conda.binstar.org/pandas || exit 1 |
| 76 | + |
| 77 | +# Useful for debugging any issues with conda |
| 78 | +conda info -a || exit 1 |
| 79 | + |
| 80 | +conda create -n pandas python=$TRAVIS_PYTHON_VERSION || exit 1 |
| 81 | +conda install -n pandas --file=ci/requirements-${TRAVIS_PYTHON_VERSION}${JOB_TAG}.txt || exit 1 |
| 82 | + |
| 83 | +conda install -n pandas pip setuptools nose || exit 1 |
| 84 | +conda remove -n pandas pandas |
| 85 | + |
| 86 | +source activate pandas |
| 87 | + |
| 88 | +# set the compiler cache to work |
| 89 | +if [ "$IRON_TOKEN" ]; then |
| 90 | + export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH |
| 91 | + gcc=$(which gcc) |
| 92 | + echo "gcc: $gcc" |
| 93 | + ccache=$(which ccache) |
| 94 | + echo "ccache: $ccache" |
| 95 | + export CC='ccache gcc' |
| 96 | +fi |
| 97 | + |
| 98 | +python setup.py build_ext --inplace && python setup.py develop |
| 99 | + |
| 100 | +for package in beautifulsoup4 'python-dateutil'; do |
| 101 | + pip uninstall --yes $package |
| 102 | +done |
| 103 | + |
| 104 | +true |
0 commit comments