Skip to content

Commit

Permalink
Merge pull request #162 from nismod/fix/ci
Browse files Browse the repository at this point in the history
Update CI testing setup
  • Loading branch information
sveneggimann committed Mar 18, 2019
2 parents 116f798 + daa0068 commit ed25180
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.pot
__pycache__/*
.cache/*
.mypy_cache/*
.*.swp
*/.ipynb_checkpoints/*

Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ virtualenv:
env:
matrix:
- DISTRIB="conda" PYTHON_VERSION="3.5" COVERAGE="true"
- DISTRIB="conda" PYTHON_VERSION="3.7" COVERAGE="true"
install:
- source tests/travis_install.sh
before_script:
Expand Down
48 changes: 36 additions & 12 deletions tests/travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,53 @@ if [[ "$DISTRIB" == "conda" ]]; then
deactivate

# Use the miniconda installer for faster download / install of conda
# itself
wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
-O miniconda.sh
chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda
export PATH=$HOME/miniconda/bin:$PATH

conda update --yes conda -c conda-forge
conda config --add channels conda-forge
# Don't ask for confirmation
conda config --set always_yes true
# Update conda
conda update conda

# Follow channel priority strictly
conda config --set channel_priority strict
# Don't change prompt
conda config --set changeps1 false

# Configure the conda environment using consistent .environment.yml
conda env create -f .environment.yml -n testenv
source activate testenv

if [[ "$PYTHON_VERSION" == "3.5" ]]; then
# Pin libgcc as possible root cause of fiona/shapely shared library import errors
conda install --yes libgcc-ng==7.2.0
if [[ "$PYTHON_VERSION" != "3.5" ]]; then
# Add conda-forge as priority channel
# conda-forge builds packages for Python 3.6 and above as of 2018-10-01
conda config --add channels conda-forge
fi

# Configure the conda environment using package names (using .environment.yml would force
# the python version)

conda create -n testenv \
python=$PYTHON_VERSION \
fiona \
haversine \
imageio \
matplotlib \
numpy \
palettable \
pytest \
pytest-cov \
scipy
# skip geopandas, pyproj from conda install (add fiona) in order to work on defaults
# channel for python 3.5

source activate testenv

fi

if [[ "$COVERAGE" == "true" ]]; then
pip install coverage coveralls
fi

# Pip install by default
pip install -r requirements.txt
# Link code to python environment
# install any packages as specified in install_requires
python setup.py develop

0 comments on commit ed25180

Please sign in to comment.