.travis.yml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: xcode8
  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: osx
  27. osx_image: xcode9
  28. language: generic
  29. env:
  30. - PYTHON_VERSION=2.7.10
  31. - PYENV_ROOT=~/.pyenv
  32. - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
  33. - os: linux
  34. dist: trusty
  35. language: python
  36. python: 2.7
  37. env:
  38. - USE_CONDA=true
  39. - os: linux
  40. dist: trusty
  41. language: python
  42. python: 3.5
  43. env:
  44. - USE_CONDA=true
  45. before_install:
  46. - if [ "$TRAVIS_OS_NAME" = "linux" -a "$USE_CONDA" = "true" ]; then
  47. if [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then
  48. wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
  49. else
  50. wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
  51. fi;
  52. bash miniconda.sh -b -p $HOME/miniconda;
  53. export PATH="$HOME/miniconda/bin:$PATH";
  54. hash -r;
  55. conda config --set always_yes yes --set changeps1 no;
  56. conda update -q conda;
  57. conda info -a;
  58. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  59. which pyenv &>/dev/null || brew install --quiet pyenv;
  60. PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install -ks $PYTHON_VERSION;
  61. mkdir -p ~/.matplotlib;
  62. echo backend':' Agg > ~/.matplotlib/matplotlibrc;
  63. fi
  64. install:
  65. - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
  66. if [ "$USE_CONDA" = "true" ]; then
  67. conda create --name=labelme python=$TRAVIS_PYTHON_VERSION -q -y;
  68. conda install pyqt=4 -q -y;
  69. conda install scikit-image -q -y;
  70. else
  71. cp -r $(dirname $($SYSTEM_PYTHON -c 'import PyQt4; print(PyQt4.__file__)')) ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  72. cp $($SYSTEM_PYTHON -c 'import sip; print(sip.__file__)') ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  73. pip install -q -U pip setuptools;
  74. pip install -q -U numpy scipy scikit-image;
  75. fi;
  76. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  77. pyenv global $PYTHON_VERSION;
  78. brew install pyqt;
  79. cp -r /usr/local/lib/python2.7/site-packages/PyQt5 ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  80. cp /usr/local/lib/python2.7/site-packages/sip.so ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  81. pip install -q -U pip setuptools;
  82. pip install -q -U numpy scipy scikit-image;
  83. fi
  84. - pip install .
  85. before_script:
  86. - pip install -q nose
  87. script:
  88. - nosetests tests
  89. notifications:
  90. email: false