.travis.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. sudo: false
  2. cache: pip
  3. matrix:
  4. include:
  5. - os: linux
  6. dist: trusty
  7. language: python
  8. env:
  9. - SYSTEM_PYTHON=/usr/bin/python
  10. - PIP=pip
  11. - PYTHON=python
  12. addons:
  13. apt:
  14. packages:
  15. - gfortran
  16. - liblapack-dev
  17. - pyqt4-dev-tools
  18. - python-qt4
  19. - os: osx
  20. osx_image: xcode9
  21. language: generic
  22. env:
  23. - PYTHON_VERSION=2.7.10
  24. - PYENV_ROOT=~/.pyenv
  25. - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
  26. - os: linux
  27. dist: trusty
  28. language: python
  29. python: 2.7
  30. env:
  31. - USE_CONDA=true
  32. - os: linux
  33. dist: trusty
  34. language: python
  35. python: 3.5
  36. env:
  37. - USE_CONDA=true
  38. before_install:
  39. - if [ "$TRAVIS_OS_NAME" = "linux" -a "$USE_CONDA" = "true" ]; then
  40. if [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then
  41. wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
  42. else
  43. wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
  44. fi
  45. bash miniconda.sh -b -p $HOME/miniconda;
  46. export PATH="$HOME/miniconda/bin:$PATH";
  47. hash -r;
  48. conda config --set always_yes yes --set changeps1 no;
  49. conda update -q conda;
  50. conda info -a;
  51. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  52. brew update >/dev/null;
  53. brew outdated pyenv || brew upgrade --quiet pyenv;
  54. PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install -ks $PYTHON_VERSION;
  55. mkdir -p ~/.matplotlib;
  56. echo "backend':' Agg" > ~/.matplotlib/matplotlibrc;
  57. fi
  58. install:
  59. - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
  60. if [ "$USE_CONDA" = "true" ]; then
  61. conda create --name=labelme python=$TRAVIS_PYTHON_VERSION -q -y;
  62. conda install pyqt=4 -q -y;
  63. else
  64. cp -r $(dirname $($SYSTEM_PYTHON -c 'import PyQt4; print(PyQt4.__file__)')) ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  65. cp $($SYSTEM_PYTHON -c 'import sip; print(sip.__file__)') ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  66. fi
  67. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  68. pyenv global $PYTHON_VERSION;
  69. brew install pyqt;
  70. cp -r /usr/local/lib/python2.7/site-packages/PyQt5 ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  71. cp /usr/local/lib/python2.7/site-packages/sip.so ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  72. pip install -U numpy scipy scikit-image;
  73. fi
  74. - python setup.py install
  75. before_script:
  76. - pip install nose
  77. script:
  78. - nosetests tests