|
| 1 | +#!/bin/bash -e |
| 2 | + |
| 3 | +# edit the locale file if needed |
| 4 | +if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then |
| 5 | + echo "Adding locale to the first line of pandas/__init__.py" |
| 6 | + rm -f pandas/__init__.pyc |
| 7 | + SEDC="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LC_ALL')\n" |
| 8 | + sed -i "$SEDC" pandas/__init__.py |
| 9 | + |
| 10 | + echo "[head -4 pandas/__init__.py]" |
| 11 | + head -4 pandas/__init__.py |
| 12 | + echo |
| 13 | +fi |
| 14 | + |
| 15 | + |
| 16 | +MINICONDA_DIR=/usr/local/miniconda |
| 17 | +if [ -e $MINICONDA_DIR ] && [ "$BITS32" != yes ]; then |
| 18 | + echo "Found Miniconda installation at $MINICONDA_DIR" |
| 19 | +else |
| 20 | + echo "Install Miniconda" |
| 21 | + DEFAULT_CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest" |
| 22 | + if [[ "$(uname -m)" == 'aarch64' ]]; then |
| 23 | + CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.10.1-4/Miniforge3-4.10.1-4-Linux-aarch64.sh" |
| 24 | + elif [[ "$(uname)" == 'Linux' ]]; then |
| 25 | + if [[ "$BITS32" == "yes" ]]; then |
| 26 | + CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86.sh" |
| 27 | + else |
| 28 | + CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86_64.sh" |
| 29 | + fi |
| 30 | + elif [[ "$(uname)" == 'Darwin' ]]; then |
| 31 | + CONDA_URL="$DEFAULT_CONDA_URL-MacOSX-x86_64.sh" |
| 32 | + else |
| 33 | + echo "OS $(uname) not supported" |
| 34 | + exit 1 |
| 35 | + fi |
| 36 | + echo "Downloading $CONDA_URL" |
| 37 | + wget -q $CONDA_URL -O miniconda.sh |
| 38 | + chmod +x miniconda.sh |
| 39 | + |
| 40 | + MINICONDA_DIR="$HOME/miniconda3" |
| 41 | + rm -rf $MINICONDA_DIR |
| 42 | + ./miniconda.sh -b -p $MINICONDA_DIR |
| 43 | +fi |
| 44 | +export PATH=$MINICONDA_DIR/bin:$PATH |
| 45 | + |
| 46 | +echo |
| 47 | +echo "which conda" |
| 48 | +which conda |
| 49 | + |
| 50 | +echo |
| 51 | +echo "update conda" |
| 52 | +conda config --set ssl_verify false |
| 53 | +conda config --set quiet true --set always_yes true --set changeps1 false |
| 54 | +conda install -y -c conda-forge -n base 'mamba>=0.21.2' pip setuptools |
| 55 | + |
| 56 | +echo "conda info -a" |
| 57 | +conda info -a |
| 58 | + |
| 59 | +echo "conda list (root environment)" |
| 60 | +conda list |
| 61 | + |
| 62 | +echo |
| 63 | +# Clean up any left-over from a previous build |
| 64 | +mamba env remove -n pandas-dev |
| 65 | +echo "mamba env update --file=${ENV_FILE}" |
| 66 | +# See https://github.com/mamba-org/mamba/issues/633 |
| 67 | +mamba create -q -n pandas-dev |
| 68 | +time mamba env update -n pandas-dev --file="${ENV_FILE}" |
| 69 | + |
| 70 | +echo "conda list -n pandas-dev" |
| 71 | +conda list -n pandas-dev |
| 72 | + |
| 73 | +if [[ "$BITS32" == "yes" ]]; then |
| 74 | + # activate 32-bit compiler |
| 75 | + export CONDA_BUILD=1 |
| 76 | +fi |
| 77 | + |
| 78 | +echo "activate pandas-dev" |
| 79 | +source activate pandas-dev |
| 80 | + |
| 81 | +# Explicitly set an environment variable indicating that this is pandas' CI environment. |
| 82 | +# |
| 83 | +# This allows us to enable things like -Werror that shouldn't be activated in |
| 84 | +# downstream CI jobs that may also build pandas from source. |
| 85 | +export PANDAS_CI=1 |
| 86 | + |
| 87 | +if pip list | grep -q ^pandas; then |
| 88 | + echo |
| 89 | + echo "remove any installed pandas package w/o removing anything else" |
| 90 | + pip uninstall -y pandas || true |
| 91 | +fi |
| 92 | + |
| 93 | +if [ "$(conda list -f qt --json)" != [] ]; then |
| 94 | + echo |
| 95 | + echo "remove qt" |
| 96 | + echo "causes problems with the clipboard, we use xsel for that" |
| 97 | + conda remove qt -y --force || true |
| 98 | +fi |
| 99 | + |
| 100 | +echo "Build extensions" |
| 101 | +python setup.py build_ext -q -j3 |
| 102 | + |
| 103 | +echo "Install pandas" |
| 104 | +python -m pip install --no-build-isolation --no-use-pep517 -e . |
| 105 | + |
| 106 | +echo "done" |
0 commit comments