Skip to content

Commit

Permalink
Enable Travis CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
yungyuc committed Jun 10, 2016
1 parent b3e5b95 commit 25ae714
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
45 changes: 45 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
language: python

sudo: required

dist: trusty

cache:
directory:
- $HOME/miniconda

env:
# Disable GCE boto plugin which is incompatible to Python 3, see
# https://github.com/travis-ci/travis-ci/issues/5246
- BOTO_CONFIG=/tmp/nowhere

python:
- "2.7"
- "3.5"

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y liblapack-pic liblapack-dev libscotch-dev libscotchmetis-dev libscotch-5.1 gmsh
# Install minimal conda
- 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"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a

install:
- conda create -q -n solvcon-test-env python=$TRAVIS_PYTHON_VERSION six setuptools pip sphinx ipython jupyter cython numpy netcdf4 nose paramiko boto
- source activate solvcon-test-env
- pip install pythreejs>=0.2.0

script:
- python setup.py build_ext --inplace
- nosetests --with-doctest
- contrib/release.sh
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ def main():
ext_modules = [
make_extension('solvcon.march', [],
include_dirs=["libmarch/include"],
extra_compile_args=['-std=c++14'],
extra_compile_args=['-std=c++11'],
language='c++'),
make_extension('solvcon._march_bridge', [],
include_dirs=["libmarch/include"],
extra_compile_args=['-std=c++14'],
extra_compile_args=['-std=c++11'],
language='c++'),
make_extension('solvcon.mesh', ['src']),
make_extension('solvcon.parcel.fake._algorithm', ['src']),
Expand Down
4 changes: 2 additions & 2 deletions solvcon/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class BlockJSONEncoder(json.JSONEncoder):
>>> # with the encoder, Block can be turned to a JSON string.
>>> import json
>>> line = json.dumps(blk, cls=BlockJSONEncoder)
>>> # what we serialized to JSON.
>>> sorted(json.loads(line).keys()) # doctest: +NORMALIZE_WHITESPACE
>>> # what we serialized to JSON. note 2/3 compatibility.
>>> sorted(str(key) for key in json.loads(line).keys()) # doctest: +NORMALIZE_WHITESPACE
['bndfcs',
'clcnd', 'clfcs', 'clgrp', 'clnds', 'cltpn', 'clvol',
'fcara', 'fccls', 'fccnd', 'fcnds', 'fcnml', 'fctpn',
Expand Down
6 changes: 2 additions & 4 deletions solvcon/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ def test_setter(self):

def test_no_setting_property(self):
tbl = Table(4, 8)
with py3kcompat.assertRaisesRegex(
self, AttributeError, "can't set attribute"):
with self.assertRaises(AttributeError):
tbl._ghostpart = np.arange(4)
with py3kcompat.assertRaisesRegex(
self, AttributeError, "can't set attribute"):
with self.assertRaises(AttributeError):
tbl._bodypart = np.arange(8)

def test_1d(self):
Expand Down

0 comments on commit 25ae714

Please sign in to comment.