Skip to content

Commit

Permalink
Merge a0ce693 into 509d906
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 2, 2019
2 parents 509d906 + a0ce693 commit b6c76c5
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 94 deletions.
227 changes: 150 additions & 77 deletions .travis.yml
@@ -1,84 +1,157 @@
language: python

# We deliberately don't use travis's language=python option because
# we install miniconda and use conda to get python. Additionally,
# Travis's auto-install of python doesn't work on osx images (see
# https://github.com/travis-ci/travis-ci/issues/4729).
language: generic
sudo: false
os:
- linux

cache:
timeout: 300
directories:
- $HOME/miniconda

python:
- "2.7"
- "3.6"
before_cache:
- rm -rf $HOME/miniconda/pkgs
- rm -rf $HOME/miniconda/conda-bld
- rm -rf $HOME/miniconda/envs/*/conda-bld

notifications:
email:
on_failure: change # [always|never|change] default: always

install:
- SITE_PACKAGES=`pip --version | cut -d ' ' -f 4`
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda

# Useful for debugging any issues with conda
- conda create -n holoviews -q python=$TRAVIS_PYTHON_VERSION
- travis_wait conda env update -n holoviews -q -f environment.yml
- source activate holoviews
- python setup.py develop
- conda info -a; conda list; conda env export
- if [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
echo "Attempting to find any associated pull request";
CURRENT_BUILD=$(curl -s -X GET "https://api.travis-ci.org/repos/ioam/holoviews/builds?number=$TRAVIS_BUILD_NUMBER");
NEXT_BUILD=$(curl -s -X GET "https://api.travis-ci.org/repos/ioam/holoviews/builds?number=$((TRAVIS_BUILD_NUMBER + 1))");
MSG1=$(echo $CURRENT_BUILD | jq '.[].message' );
MSG2=$(echo $NEXT_BUILD | jq '.[].message' );
if [ "$MSG1" == "$MSG2" ] ; then
BUILD_ID=$(echo $NEXT_BUILD | jq .[].id);
TRAVIS_PULL_REQUEST=$(curl -s -X GET "https://api.travis-ci.org/repos/ioam/holoviews/builds/$BUILD_ID" | jq .compare_url | cut -d '/' -f7 | cut -d \" -f1);
echo "Associated pull request found - PR $TRAVIS_PULL_REQUEST";
fi
fi
- REF_DATA_BRANCH=${TRAVIS_PULL_REQUEST//false/reference_data}
- git clone https://github.com/ioam/holoviews-data.git -b reference_data ./doc/reference_data
- cd ./doc/reference_data
- echo "Attempting to checkout $REF_DATA_BRANCH branch"
- if [ $(git branch -a --list *origin/$REF_DATA_BRANCH | wc -l) -eq 1 ] ; then
git checkout origin/$REF_DATA_BRANCH;
else
echo "Using the master branch reference data";
fi
- cd ../..

script:
- export MPLBACKEND="Agg"
- export HOLOVIEWSRC=`pwd`'/holoviews.rc'
- echo 'import holoviews as hv;hv.config(style_17=True);hv.config.warn_options_call=True' > holoviews.rc
- flake8 --ignore=E,W,F999,F405 holoviews
- nosetests --with-doctest --with-coverage --cover-package=holoviews
- cd doc/nbpublisher; chmod +x test_notebooks.py; QT_QPA_PLATFORM='offscreen' BOKEH_DEV=True ./test_notebooks.py
- chmod +x concat_html.py; ./concat_html.py ../test_data ../test_html
- cd ../../; mv doc/Tutorials/.coverage ./.coverage.notebooks
- coverage combine --append

after_script:
- shopt -s expand_aliases
- alias decode="tr '[N-ZA-Mn-za-m]' '[A-Za-z]'"
- export AWS_SECRET_ACCESS_KEY=`echo udgGztmYyyKZ5iP2PVe+ROGZo/TI0M2QcoafOJGD | decode`
- export AWS_ACCESS_KEY_ID=`echo NXVNVUCXF3UPHSKNG7ND | decode`
- if [ "$TRAVIS_BRANCH" == 'master' ]; then
cd doc/test_data;
zip -r test_data.zip *;
aws s3 cp --region eu-west-1 ./test_data.zip "s3://preview.holoviews.org/$TRAVIS_BUILD_NUMBER/test_data_py${TRAVIS_PYTHON_VERSION:0:1}.zip";
cd -;
fi
- aws s3 cp --recursive --region eu-west-1 ./doc/test_html "s3://travis.holoviews.org/build_$TRAVIS_BUILD_NUMBER"
- curl -s -X GET "https://kq5y73i0xe.execute-api.eu-west-1.amazonaws.com/dev/travis-holoviews-index"
- echo insecure >> ~/.curlrc
- if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
curl -X POST -d "$TRAVIS_BUILD_NUMBER" "https://kq5y73i0xe.execute-api.eu-west-1.amazonaws.com/dev/pr-status";
fi

after_success: coveralls
env:
global:
- PYENV_VERSION=3.6
- PKG_TEST_PYTHON="--test-python=py36 --test-python=py27"
- CHANS_DEV="-c pyviz/label/dev -c conda-forge"
- CHANS="-c pyviz"
- MPLBACKEND="Agg"

stages:
- test
- name: conda_dev_package
if: tag =~ ^v(\d+|\.)*[a-z]\d*$
- name: pip_dev_package
if: tag =~ ^v(\d+|\.)*[a-z]\d*$
- name: conda_package
if: tag =~ ^v(\d+|\.)*[^a-z]\d*$
- name: pip_package
if: tag =~ ^v(\d+|\.)*[^a-z]\d*$

jobs:
include:
########## Test Stage ##########

- &default
stage: test
env: DESC="Python 3 tests"
before_install:
- pip install pyctdev && doit miniconda_install && pip uninstall -y doit pyctdev
- export PATH="$HOME/miniconda/bin:$PATH" && hash -r
- conda config --set always_yes True
- conda install -c pyviz "pyctdev>=0.5" && doit ecosystem_setup
install:
- doit env_create $CHANS_DEV --python=$PYENV_VERSION
- source activate test-environment
- doit develop_install $CHANS_DEV -o all
- doit env_capture
- bokeh sampledata
script:
- doit test_all_recommended
after_script:
- chmod +x concat_html.py; ./concat_html.py ../test_data ../test_html
- cd ../../; mv doc/Tutorials/.coverage ./.coverage.notebooks
- coverage combine --append
- if [ "$TRAVIS_BRANCH" == 'master' ]; then
cd doc/test_data;
zip -r test_data.zip *;
aws s3 cp --region eu-west-1 ./test_data.zip "s3://preview.holoviews.org/$TRAVIS_BUILD_NUMBER/test_data_py${TRAVIS_PYTHON_VERSION:0:1}.zip";
cd -;
fi
- aws s3 cp --recursive --region eu-west-1 ./doc/test_html "s3://travis.holoviews.org/build_$TRAVIS_BUILD_NUMBER"
- curl -s -X GET "https://kq5y73i0xe.execute-api.eu-west-1.amazonaws.com/dev/travis-holoviews-index"
- echo insecure >> ~/.curlrc
- if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
curl -X POST -d "$TRAVIS_BUILD_NUMBER" "https://kq5y73i0xe.execute-api.eu-west-1.amazonaws.com/dev/pr-status";
fi
after_success: coveralls
after_failure: sleep 10

- <<: *default
env: DESC="Python 2.7 tests" PYENV_VERSION=2.7

- &regression_test
<<: *default
env: DESC="Python 3.6 regression tests"
before_script:
- if [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
echo "Attempting to find any associated pull request";
CURRENT_BUILD=$(curl -s -X GET "https://api.travis-ci.org/repos/ioam/holoviews/builds?number=$TRAVIS_BUILD_NUMBER");
NEXT_BUILD=$(curl -s -X GET "https://api.travis-ci.org/repos/ioam/holoviews/builds?number=$((TRAVIS_BUILD_NUMBER + 1))");
MSG1=$(echo $CURRENT_BUILD | jq '.[].message' );
MSG2=$(echo $NEXT_BUILD | jq '.[].message' );
if [ "$MSG1" == "$MSG2" ] ; then
BUILD_ID=$(echo $NEXT_BUILD | jq .[].id);
TRAVIS_PULL_REQUEST=$(curl -s -X GET "https://api.travis-ci.org/repos/ioam/holoviews/builds/$BUILD_ID" | jq .compare_url | cut -d '/' -f7 | cut -d \" -f1);
echo "Associated pull request found - PR $TRAVIS_PULL_REQUEST";
fi
fi
- REF_DATA_BRANCH=${TRAVIS_PULL_REQUEST//false/reference_data}
- git clone https://github.com/ioam/holoviews-data.git -b reference_data ./doc/reference_data
- pushd ./doc/reference_data
- echo "Attempting to checkout $REF_DATA_BRANCH branch"
- if [ $(git branch -a --list *origin/$REF_DATA_BRANCH | wc -l) -eq 1 ] ; then
git checkout origin/$REF_DATA_BRANCH;
else
echo "Using the master branch reference data";
fi
- popd
- export HOLOVIEWSRC=`pwd`'/holoviews.rc'
- echo 'import holoviews as hv;hv.config(style_17=True);hv.config.warn_options_call=True' > holoviews.rc
script:
- QT_QPA_PLATFORM='offscreen' BOKEH_DEV=True doit test_examples

- <<: *regression_test
env: DESC="Python 2.7 regression tests" PYENV_VERSION=2.7

########## END-USER PACKAGES ##########

### CONDA ####

- <<: *default
stage: conda_dev_package
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID
install:
- doit package_build $CHANS_DEV $PKG_TEST_PYTHON --test-group=unit
script:
- doit package_upload --token=$CONDA_UPLOAD_TOKEN --label=dev

- <<: *default
stage: conda_package
env: DESC="" TRAVIS_NOCACHE=$TRAVIS_JOB_ID
install:
- doit package_build $CHANS $PKG_TEST_PYTHON --test-group=unit
script:
- doit package_upload --token=$CONDA_UPLOAD_TOKEN --label=dev --label=main

### PyPI ###

- <<: *default
stage: pip_dev_package
env: PYPI="https://test.pypi.org/legacy/" TRAVIS_NOCACHE=$TRAVIS_JOB_ID
install:
- doit develop_install $CHANS_DEV -o tests && pip uninstall -y hvplot
- doit pip_on_conda
- doit ecosystem=pip package_build --test-python=py36 --test-group=unit
script: doit ecosystem=pip package_upload -u $TPPU -p $TPPP -r ${PYPI}

- <<: *default
stage: pip_package
env: PYPI="https://upload.pypi.org/legacy/" TRAVIS_NOCACHE=$TRAVIS_JOB_ID
install:
- doit develop_install $CHANS_DEV -o tests && pip uninstall -y hvplot
- doit pip_on_conda
- doit ecosystem=pip package_build --test-python=py36 --test-group=unit
script: doit ecosystem=pip package_upload -u $PPU -p $PPP -r ${PYPI}
17 changes: 17 additions & 0 deletions dodo.py
@@ -0,0 +1,17 @@
import os
if "PYCTDEV_ECOSYSTEM" not in os.environ:
os.environ["PYCTDEV_ECOSYSTEM"] = "conda"

from pyctdev import * # noqa: api


def task_pip_on_conda():
"""Experimental: provide pip build env via conda"""
return {'actions':[
# some ecosystem=pip build tools must be installed with conda when using conda...
'conda install -y pip twine wheel',
# ..and some are only available via conda-forge
'conda install -y -c conda-forge tox virtualenv',
# this interferes with pip-installed nose
'conda remove -y --force nose'
]}
2 changes: 1 addition & 1 deletion holoviews/plotting/util.py
Expand Up @@ -736,7 +736,7 @@ def list_cmaps(provider=None, records=False, name=None, category=None, source=No
# cmap_info stores only non-reversed info, so construct
# suitable values for reversed version if appropriate
r=r._replace(name=aname)
if aname.endswith('_r') and (r.category is not 'Diverging'):
if aname.endswith('_r') and (r.category != 'Diverging'):
if r.bg=='light':
r=r._replace(bg='dark')
elif r.bg=='dark':
Expand Down
44 changes: 28 additions & 16 deletions setup.py
Expand Up @@ -11,22 +11,31 @@

setup_args = {}
install_requires = ['param>=1.8.0,<2.0', 'numpy>=1.0', 'pyviz_comms>=0.7.0']

extras_require = {}

# Notebook dependencies of IPython 3
extras_require['notebook-dependencies'] = ['ipython<=7.1.1,>=5.4.0',
'pyzmq', 'jinja2', 'tornado',
'jsonschema', 'notebook', 'pygments']
# IPython Notebook + matplotlib
extras_require['recommended'] = extras_require['notebook-dependencies'] + ['matplotlib>=2.1', 'bokeh>=1.0.0']
# Additional, useful third-party packages
extras_require['extras'] = (['pandas', 'seaborn']
+ extras_require['recommended'])
# Everything including cyordereddict (optimization) and nosetests
extras_require['all'] = (extras_require['recommended']
+ extras_require['extras']
+ ['cyordereddict', 'nose'])
# Notebook dependencies
extras_require['notebook'] = ['ipython>=5.4.0,<=7.1.1', 'notebook']

# IPython Notebook + pandas + matplotlib + bokeh
extras_require['recommended'] = extras_require['notebook'] + [
'pandas', 'matplotlib>=2.1', 'bokeh>=1.0.0', 'scipy']

# Requirements to run all examples
extras_require['examples'] = extras_require['recommended'] + [
'networkx', 'pillow>=5.3.0', 'xarray>=0.10.4', 'flexx==0.4.1',
'plotly>=3.4', 'datashader', 'selenium', 'phantomjs', 'ffmpeg']

# Extra third-party libraries
extras_require['extras'] = extras_require['examples']+['cyordereddict']

# Test requirements
extras_require['tests'] = extras_require['extras']+[
'nose', 'flake8==3.6.0', 'awscli', 'coveralls', 'deepdiff',
'path.py', 'nbconvert==5.3.1', 'jsonschema==2.6.0']

# Everything including cyordereddict (optimization) and nosetests
extras_require['all'] = extras_require['tests']


def embed_version(basepath, ref='v0.2.2'):
Expand Down Expand Up @@ -63,6 +72,9 @@ def get_setup_version(reponame):
version_file_path = os.path.join(basepath, reponame, '.version')
try:
from param import version

# Ensure that param.version has Version object
assert hasattr(version, 'Version')
except:
version = embed_version(basepath)
if version is not None:
Expand All @@ -81,11 +93,11 @@ def get_setup_version(reponame):
long_description_content_type="text/markdown",
author="Jean-Luc Stevens and Philipp Rudiger",
author_email="holoviews@gmail.com",
maintainer="IOAM",
maintainer_email="holoviews@gmail.com",
maintainer="PyViz Developers",
maintainer_email="developers@pyviz.org",
platforms=['Windows', 'Mac OS X', 'Linux'],
license='BSD',
url='http://www.holoviews.org',
url='https://www.holoviews.org',
entry_points={
'console_scripts': [
'holoviews = holoviews.util.command:main'
Expand Down
57 changes: 57 additions & 0 deletions tox.ini
@@ -0,0 +1,57 @@
# For use with pyct (https://github.com/pyviz/pyct), but just standard
# tox config (works with tox alone).

[tox]
# python version test group extra envs extra commands
envlist = {py27,py35,py36}-{flakes,unit,all_recommended}-{default}-{dev,pkg}

[_flakes]
description = Flake check python
deps = .[tests]
commands = flake8 holoviews

[_unit]
description = Run unit tests with coverage
deps = .[tests]
passenv = TRAVIS TRAVIS_*
commands = nosetests --with-doctest --with-coverage --cover-package=holoviews

[_examples]
description = Test that examples run
deps = .[tests]
commands =
cd doc/nbpublisher
chmod +x test_notebooks.py
./test_notebooks.py

[_all_recommended]
description = Run all recommended tests
deps = .[recommended, tests]
commands = {[_flakes]commands}
{[_unit]commands}

[_pkg]
commands = bokeh sampledata

[testenv]
sitepackages = True
install_command = pip install --no-deps {opts} nose {packages}

changedir = {envtmpdir}

commands = examples-pkg: {[_pkg]commands}
unit: {[_unit]commands}
flakes: {[_flakes]commands}
all_recommended: {[_all_recommended]commands}

deps = unit: {[_unit]deps}
flakes: {[_flakes]deps}
all_recommended: {[_all_recommended]deps}

[flake8]
include = *.py
exclude = .git,__pycache__,.tox,.eggs,*.egg,doc,dist,build,_build,.ipynb_checkpoints,run_test.py
ignore = E,
W,
F999,
F405

0 comments on commit b6c76c5

Please sign in to comment.