.travis.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. - MPLBACKEND=Agg
  13. addons:
  14. apt:
  15. packages:
  16. - gfortran
  17. - liblapack-dev
  18. - pyqt4-dev-tools
  19. - python-qt4
  20. # FIXME: brew cannot be run on Travis.
  21. # - os: osx
  22. # osx_image: xcode8
  23. # language: generic
  24. # env:
  25. # - PYTHON_VERSION=2.7.10
  26. # - PYENV_ROOT=~/.pyenv
  27. # - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
  28. # - os: osx
  29. # osx_image: xcode9
  30. # language: generic
  31. # env:
  32. # - PYTHON_VERSION=2.7.10
  33. # - PYENV_ROOT=~/.pyenv
  34. # - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
  35. - os: linux
  36. dist: trusty
  37. language: python
  38. python: 2.7
  39. env:
  40. - USE_CONDA=true
  41. - os: linux
  42. dist: trusty
  43. language: python
  44. python: 3.5
  45. env:
  46. - USE_CONDA=true
  47. before_install:
  48. - if [ "$USE_CONDA" = "true" ]; then
  49. if [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then
  50. wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
  51. else
  52. wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
  53. fi;
  54. bash miniconda.sh -b -p $HOME/miniconda;
  55. export PATH="$HOME/miniconda/bin:$PATH";
  56. hash -r;
  57. conda config --set always_yes yes --set changeps1 no;
  58. conda update -q conda;
  59. conda info -a;
  60. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  61. which pyenv &>/dev/null || brew install --quiet pyenv;
  62. PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install -ks $PYTHON_VERSION;
  63. mkdir -p ~/.matplotlib;
  64. echo backend':' Agg > ~/.matplotlib/matplotlibrc;
  65. fi
  66. install:
  67. - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
  68. if [ "$USE_CONDA" = "true" ]; then
  69. conda create --name=labelme python=$TRAVIS_PYTHON_VERSION -q -y;
  70. conda install pyqt=4 -q -y;
  71. conda install scikit-image -q -y;
  72. else
  73. cp -r $(dirname $($SYSTEM_PYTHON -c 'import PyQt4; print(PyQt4.__file__)')) ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  74. cp $($SYSTEM_PYTHON -c 'import sip; print(sip.__file__)') ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  75. pip install -q -U pip setuptools;
  76. pip install -q -U numpy scipy scikit-image;
  77. fi;
  78. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  79. pyenv global $PYTHON_VERSION;
  80. brew install pyqt;
  81. cp -r /usr/local/lib/python2.7/site-packages/PyQt5 ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  82. cp /usr/local/lib/python2.7/site-packages/sip.so ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  83. pip install -q -U pip setuptools;
  84. pip install -q -U numpy scipy scikit-image;
  85. fi
  86. - pip install .
  87. before_script:
  88. - pip install -q pytest
  89. script:
  90. - pytest -v tests
  91. - labelme --help
  92. - (cd examples/single_image && rm -rf apc2016_obj3_json && labelme_json_to_dataset apc2016_obj3.json && python load_label_png.py && git checkout -- .)
  93. - (cd examples/semantic_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  94. branches:
  95. only:
  96. - master
  97. notifications:
  98. email: false