Skip to content
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

Fix travis #458

Merged
merged 5 commits into from
Feb 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 3 additions & 48 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,15 @@ language: python
sudo: required

python:
- 2.7
- 3.5
- 3.6

env:
matrix:
- BUILD="test" INSTALL="conda"
- BUILD="test" INSTALL="pip"

matrix:
include:
- python: 3.6
env: BUILD="docs" INSTALL="pip"
allow_failures:
- env: BUILD="docs"

before_install:
- if [[ $INSTALL == 'pip' ]]; then
pip install pip --upgrade;
pip install -r requirements.txt;
elif [[ $INSTALL == 'conda' ]]; then
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-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";
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
conda info -a;
conda config --add channels conda-forge;
conda create -q -n testenv python=$TRAVIS_PYTHON_VERSION pytest;
source activate testenv;
conda install --file requirements.txt;
fi
- if [[ $BUILD == 'docs' ]]; then
if [[ $INSTALL == 'conda' ]]; then
conda install --file doc/requirements.txt;
elif [[ $INSTALL == 'pip' ]]; then
pip install -r doc/requirements.txt;
fi
fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then
sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++;
npm install canvas vega vega-lite;
fi
pip install pip --upgrade;
pip install -r requirements.txt;

install:
- python setup.py install

script:
- if [[ $BUILD == 'test' ]]; then
python -m pytest altair --doctest-modules;
elif [[ $BUILD == 'docs' ]]; then
cd doc && make html;
fi
python -m pytest altair
1 change: 0 additions & 1 deletion altair/vega/v3/schema/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions altair/vegalite/v2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ def _repr_mimebundle_(self, include, exclude):
"""Return a MIME bundle for display in Jupyter frontends."""
return renderers.get()(self.to_dict())

def display(self):
from vega3 import VegaLite
return VegaLite(self.to_dict())


class Chart(TopLevelMixin, core.TopLevelFacetedUnitSpec):
def __init__(self, data=Undefined, encoding=Undefined, mark=Undefined,
Expand Down
Empty file.
28 changes: 28 additions & 0 deletions altair/vegalite/v2/examples/tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
from os.path import join, dirname, abspath

import pytest

EXAMPLE_DIR = abspath(join(dirname(__file__), '..'))


def iter_example_filenames():
for filename in os.listdir(EXAMPLE_DIR):
if filename.startswith('__'):
continue
if not filename.endswith('.py'):
continue
yield filename


@pytest.mark.parametrize('filename', iter_example_filenames())
def test_examples(filename):
with open(join(EXAMPLE_DIR, filename)) as f:
source = f.read()
globals_ = {}
exec(source, globals_)

if 'chart' not in globals_:
raise ValueError("Example file should define a chart variable")
chart = globals_['chart']
dct = chart.to_dict()
11 changes: 6 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
traitlets>=4.3.1
entrypoints
ipython
pandas
vega==0.4.4
mypy
mypy_extensions
jsonschema
numpy
pandas
pytest
six
toolz
vega_datasets
19 changes: 9 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,27 @@ def find_packages(top=HERE):
NAME = "altair"
PACKAGES = find_packages()
PACKAGE_DATA = {'altair': [
'datasets/*.json',
'expr/*.json',
'vega/v2/*.json',
'vega/v3/*.json',
'vegalite/v1/schema/*.json',
'vegalite/v1/*.json',
'vegalite/v2/*.json'
]
}
AUTHOR = "Brian E. Granger / Jake VanderPlas"
AUTHOR_EMAIL = "ellisonbg@gmail.com / jakevdp@cs.washington.edu"
AUTHOR_EMAIL = "ellisonbg@gmail.com / jakevdp@gmail.com"
URL = 'http://altair-viz.github.io'
DOWNLOAD_URL = 'http://github.com/altair-viz/altair/'
LICENSE = 'BSD 3-clause'
INSTALL_REQUIRES = ['traitlets>=4.3.1',
INSTALL_REQUIRES = ['entrypoints',
'ipython',
'pandas',
'vega==0.4.4',
'mypy',
'mypy_extensions',
'jsonschema',
'toolz'
]
'numpy',
'pandas',
'pytest',
'six',
'toolz',
'vega_datasets']
VERSION = version('altair/__init__.py')


Expand Down