Skip to content

Commit

Permalink
FIX: Travis-CI fails due to no QT5
Browse files Browse the repository at this point in the history
Updated travis-ci to include pyqt5 and QT5
  • Loading branch information
pseudocubic committed Mar 22, 2016
1 parent 93b08d6 commit 263a722
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ install:
- conda create --yes -q -n test_environment python=$TRAVIS_PYTHON_VERSION nomkl pip
setuptools cython numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION nose matplotlib=$MATPLOTLIB_VERSION
six mock h5py
- conda install --yes -q -c https://conda.anaconda.org/dsdale24 pyqt5
- source activate test_environment
- pip install pep8 python-coveralls codecov
- pip install -e . -q --no-deps
before_script: # configure a headless display to test plot generation
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
script:
- nosetests --with-coverage --cover-package=neutronpy --logging-level=INFO
after_success:
Expand Down
6 changes: 5 additions & 1 deletion neutronpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
from . import spurion
from . import lattice
from . import io
from . import gui
from .kmpfit import Fitter
from .energy import Energy
from .data import Data

try:
from . import gui
except ImportError:
print('Warning: PyQt5 not found, cannot run Resolution GUI')

__version__ = '1.0.0b1'
2 changes: 1 addition & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import unittest
from mock import patch
from matplotlib import use
use('Agg')
import numpy as np
from scipy.integrate import simps
from neutronpy import Energy, Data, functions
from neutronpy.io import load_data, save_data, detect_filetype
from neutronpy.constants import BOLTZMANN_IN_MEV_K
use('Agg')


def build_data(clean=True):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import unittest
from mock import patch
from matplotlib import use
use('Agg')
import numpy as np
from neutronpy import instrument
from neutronpy.io import load_instrument
from neutronpy.sample import Sample
from neutronpy.instrument_tools import get_bragg_widths, fproject
use('Agg')


def angle2(x, y, z, h, k, l, lattice):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_structure_factors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import numpy as np
from mock import patch
from matplotlib import use
use('Agg')
from neutronpy.material import Material
from neutronpy.structure_factors import MagneticFormFactor
use('Agg')


class StructureFactor(unittest.TestCase):
Expand Down

0 comments on commit 263a722

Please sign in to comment.