From daa006854872e7a9b538af70923c0afef471c5fa Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Mon, 18 Mar 2019 14:45:28 +0000 Subject: [PATCH] Update CI testing setup - use latest miniconda installer - add Python 3.7 to test matrix - use conda defaults channel (not conda-forge) for Python 3.5 --- .gitignore | 1 + .travis.yml | 1 + tests/travis_install.sh | 48 ++++++++++++++++++++++++++++++----------- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 77fbb54d..602da46b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ *.pot __pycache__/* .cache/* +.mypy_cache/* .*.swp */.ipynb_checkpoints/* diff --git a/.travis.yml b/.travis.yml index 9be6b3e2..1213d1bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/tests/travis_install.sh b/tests/travis_install.sh index b8c31f7b..8823211c 100644 --- a/tests/travis_install.sh +++ b/tests/travis_install.sh @@ -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