-
- Notifications
You must be signed in to change notification settings - Fork 19.2k
CI: unify environment creation #24632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
04b9abb 4ae7b16 2b2b565 e9a8442 a8d22f3 730ab53 c5d357f abaf652 14d164a 6d469db 8d34048 6b22414 625ddce e68b1e2 39e3365 595815a ae538e5 784244a 6d333ab 7016f52 583b42d d3e9530 f6ea4c2 4cbc587 54cca4d e66a69c b9cedb1 549a297 e400387 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,152 @@ | ||
| #!/bin/bash | ||
| | ||
| | ||
| set -v -e | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| # edit the locale file if needed | ||
| function edit_init() | ||
| { | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| if [ -n "$LOCALE_OVERRIDE" ]; then | ||
| echo "[Adding locale to the first line of pandas/__init__.py]" | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| rm -f pandas/__init__.pyc | ||
| sedc="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LOCALE_OVERRIDE')\n" | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| sed -i "$sedc" pandas/__init__.py | ||
| echo "[head -4 pandas/__init__.py]" | ||
| head -4 pandas/__init__.py | ||
| echo | ||
| fi | ||
| } | ||
| | ||
| edit_init | ||
| | ||
| home_dir=$(pwd) | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| echo | ||
| echo "[home_dir]: $home_dir" | ||
| | ||
| # install miniconda | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| MINICONDA_DIR="$HOME/miniconda3" | ||
| | ||
| echo | ||
| echo "[Using clean Miniconda install]" | ||
| | ||
| if [ -d "$MINICONDA_DIR" ]; then | ||
| rm -rf "$MINICONDA_DIR" | ||
| fi | ||
| | ||
| | ||
| # Install Miniconda | ||
| unamestr=`uname` | ||
| if [[ "$unamestr" == 'Linux' ]]; then | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| if [[ "$BITS32" == "yes" ]]; then | ||
| wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86.sh -O miniconda.sh | ||
| else | ||
| wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
| fi | ||
| elif [[ "$unamestr" == 'Darwin' ]]; then | ||
| wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| else | ||
jreback marked this conversation as resolved. Show resolved Hide resolved | ||
| echo Error | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| fi | ||
| chmod +x miniconda.sh | ||
| ./miniconda.sh -b | ||
| | ||
| | ||
| echo | ||
| echo "[show conda]" | ||
| which conda | ||
| | ||
| echo | ||
| echo "[update conda]" | ||
| conda config --set ssl_verify false || exit 1 | ||
| conda config --set quiet true --set always_yes true --set changeps1 false || exit 1 | ||
| conda update -q conda | ||
| | ||
| # Useful for debugging any issues with conda | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| conda info -a || exit 1 | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| # set the compiler cache to work | ||
| echo | ||
| if [ -z "$NOCACHE" ] && [ "${TRAVIS_OS_NAME}" == "linux" ]; then | ||
saurav2608 marked this conversation as resolved. Show resolved Hide resolved | ||
| echo "[Using ccache]" | ||
| export PATH=/usr/lib/ccache:/usr/lib64/ccache:$PATH | ||
| gcc=$(which gcc) | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| echo "[gcc]: $gcc" | ||
| ccache=$(which ccache) | ||
| echo "[ccache]: $ccache" | ||
| export CC='ccache gcc' | ||
| elif [ -z "$NOCACHE" ] && [ "${TRAVIS_OS_NAME}" == "osx" ]; then | ||
| echo "[Install ccache]" | ||
| brew install ccache > /dev/null 2>&1 | ||
| echo "[Using ccache]" | ||
| export PATH=/usr/local/opt/ccache/libexec:$PATH | ||
| gcc=$(which gcc) | ||
| echo "[gcc]: $gcc" | ||
| ccache=$(which ccache) | ||
| echo "[ccache]: $ccache" | ||
| else | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @datapythonista I think nowadays this caching might be counter-productive, though needs some testing, if you want to make an issue to remove it (but don't touch here) | ||
| echo "[Not using ccache]" | ||
| fi | ||
| | ||
| # Deactivate any environment | ||
| source deactivate | ||
saurav2608 marked this conversation as resolved. Show resolved Hide resolved | ||
| # Display root environment (for debugging) | ||
| conda list | ||
| # Clean up any left-over from a previous build | ||
saurav2608 marked this conversation as resolved. Show resolved Hide resolved | ||
| # (note workaround for https://github.com/conda/conda/issues/2679: | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this also maybe can removed in the future (not here) @datapythonista | ||
| # `conda env remove` issue) | ||
| conda remove --all -q -y -n pandas-dev | ||
| | ||
| echo | ||
| echo "[create env]" | ||
| | ||
| # create our environment | ||
| time conda env create -q --file="${ENV_FILE}" || exit 1 | ||
| | ||
| set +v | ||
| source activate pandas-dev | ||
| set -v | ||
| ||
| | ||
| # remove any installed pandas package | ||
| # w/o removing anything else | ||
| ||
| echo | ||
| echo "[removing installed pandas]" | ||
| conda remove pandas -y --force || true | ||
| pip uninstall -y pandas || true | ||
| | ||
| echo | ||
| echo "[no installed pandas]" | ||
| conda list pandas | ||
| | ||
| | ||
| if [ -n "$LOCALE_OVERRIDE" ]; then | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| sudo locale-gen "$LOCALE_OVERRIDE" | ||
| fi | ||
| | ||
| #!/bin/bash | ||
| | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| # Make sure any error below is reported as such | ||
| set -v -e | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| echo "[building extensions]" | ||
| python setup.py build_ext -q --inplace | ||
| python -m pip install -e . | ||
| | ||
| echo | ||
| echo "[show environment]" | ||
| conda list | ||
jreback marked this conversation as resolved. Show resolved Hide resolved | ||
| | ||
| echo | ||
| echo "[done]" | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| #!/bin/bash | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| if [ "${TRAVIS_OS_NAME}" != "linux" ]; then | ||
| echo "not using dbs on non-linux" | ||
| exit 0 | ||
| fi | ||
| | ||
| echo "installing dbs" | ||
| mysql -e 'create database pandas_nosetest;' | ||
| psql -c 'create database pandas_nosetest;' -U postgres | ||
| | ||
| echo "done" | ||
| exit 0 | ||
saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved saurav2608 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
Uh oh!
There was an error while loading. Please reload this page.