Skip to content
Snippets Groups Projects
Commit d58579d0 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add tests/travis_install.sh

parent 8cf08045
No related merge requests found
Pipeline #22255 failed with stage
in 3 minutes and 5 seconds
#!/bin/bash
# This script is meant to be called by the "install" step defined in
# .travis.yml. See http://docs.travis-ci.com/ for more details.
# The behavior of the script is controlled by environment variabled defined
# in the .travis.yml in the top level folder of the project.
#
# This script is inspired by Scikit-Learn (http://scikit-learn.org/)
#
# THIS SCRIPT IS SUPPOSED TO BE AN EXAMPLE. MODIFY IT ACCORDING TO YOUR NEEDS!
set -e
if [[ "$DISTRIB" == "conda" ]]; then
# Deactivate the travis-provided virtual environment and setup a
# conda-based environment instead
deactivate
if [[ -f "$HOME/miniconda/bin/conda" ]]; then
echo "Skip install conda [cached]"
else
# By default, travis caching mechanism creates an empty dir in the
# beginning of the build, but conda installer aborts if it finds an
# existing folder, so let's just remove it:
rm -rf "$HOME/miniconda"
# Use the miniconda installer for faster download / install of conda
# itself
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
-O miniconda.sh
chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda
fi
export PATH=$HOME/miniconda/bin:$PATH
# Make sure to use the most updated version
conda update --yes conda
# Configure the conda environment and put it in the path using the
# provided versions
# (prefer local venv, since the miniconda folder is cached)
conda create -p ./.venv --yes python=${PYTHON_VERSION} pip virtualenv
source activate ./.venv
alias pip3='python -m pip'
shopt -s expand_aliases
fi
# for all
pip3 install -U pip wheel setuptools
pip3 install -U cppimport pybind11
pip3 install tox
pip3 install codecov
pip3 install sphinx
if [[ -z "$PYSTENCIL_FROM_PIP" ]]; then
pip install git+https://github.com/mabau/pystencils.git
else
pip install pystencils
fi
pip install flake8
if [[ "$COVERAGE" == "true" ]]; then
pip3 install -U pytest-cov pytest-virtualenv coverage coveralls flake8
fi
travis-cleanup() {
printf "Cleaning up environments ... " # printf avoids new lines
if [[ "$DISTRIB" == "conda" ]]; then
# Force the env to be recreated next time, for build consistency
source deactivate
conda remove -p ./.venv --all --yes
rm -rf ./.venv
fi
echo "DONE"
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment