.travis.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. language: generic
  2. sudo: required
  3. dist: trusty
  4. env:
  5. global:
  6. # used by ci-helpers
  7. - SETUP_XVFB=true
  8. - PIP_DEPENDENCIES='hacking pytest pytest-qt'
  9. - MPLBACKEND=TkAgg # for osx
  10. matrix:
  11. include:
  12. - os: linux
  13. dist: trusty
  14. env:
  15. - PYTEST_QT_API=pyqt4v2
  16. - PYQT_PACKAGE='pyqt=4'
  17. - PYTHON_VERSION=2.7
  18. - os: linux
  19. dist: trusty
  20. env:
  21. - PYTEST_QT_API=pyside2
  22. - CONDA_CHANNELS='conda-forge'
  23. - PYQT_PACKAGE='pyside2'
  24. - PYTHON_VERSION=2.7
  25. - os: linux
  26. dist: trusty
  27. env:
  28. - PYTEST_QT_API=pyside2
  29. - CONDA_CHANNELS='conda-forge'
  30. - PYQT_PACKAGE='pyside2'
  31. - PYTHON_VERSION=3.6
  32. - os: linux
  33. dist: trusty
  34. env:
  35. - PYTEST_QT_API=pyqt5
  36. - PYQT_PACKAGE='pyqt=5'
  37. - PYTHON_VERSION=2.7
  38. - os: linux
  39. dist: trusty
  40. env:
  41. - PYTEST_QT_API=pyqt5
  42. - PYQT_PACKAGE='pyqt=5'
  43. - PYTHON_VERSION=3.6
  44. - RUN_PYINSTALLER=true
  45. - os: osx
  46. env:
  47. - PYTEST_QT_API=pyqt5
  48. - PYQT_PACKAGE='pyqt=5'
  49. - PYTHON_VERSION=3.6
  50. - RUN_PYINSTALLER=true
  51. install:
  52. - |
  53. if [ $TRAVIS_OS_NAME = "linux" ]; then
  54. sudo apt-get update
  55. # Xvfb / window manager
  56. sudo apt-get install -y xvfb herbstluftwm
  57. elif [ $TRAVIS_OS_NAME = "osx" ]; then
  58. brew cask install xquartz
  59. fi
  60. # Setup miniconda
  61. - git clone --depth 1 git://github.com/astropy/ci-helpers.git
  62. - CONDA_DEPENDENCIES=$PYQT_PACKAGE source ci-helpers/travis/setup_conda.sh
  63. - source activate test && export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
  64. - pip install .
  65. # https://github.com/wkentaro/labelme/issues/183
  66. - |
  67. if [ $TRAVIS_OS_NAME = "osx" ]; then
  68. pip uninstall -y Pillow
  69. conda install -y Pillow
  70. fi
  71. before_script:
  72. - if [ $TRAVIS_OS_NAME = "linux" ]; then (herbstluftwm )& fi
  73. - if [ $TRAVIS_OS_NAME = "osx" ]; then (sudo Xvfb :99 -ac -screen 0 1024x768x8 )& fi
  74. - sleep 1
  75. script:
  76. - flake8 examples labelme setup.py tests
  77. - pytest -v tests
  78. - labelme --help
  79. - labelme --version
  80. - (cd examples/tutorial && rm -rf apc2016_obj3_json && labelme_json_to_dataset apc2016_obj3.json && python load_label_png.py && git checkout -- .)
  81. - (cd examples/semantic_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  82. - (cd examples/instance_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  83. - (cd examples/video_annotation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  84. after_script:
  85. - |
  86. if [ $RUN_PYINSTALLER = "true" ]; then
  87. # Cleanup
  88. pip uninstall -y $PIP_DEPENDENCIES
  89. # Build the standalone executable
  90. pip install pyinstaller
  91. pyinstaller labelme.spec
  92. dist/labelme --version
  93. fi
  94. branches:
  95. only:
  96. - master
  97. notifications:
  98. email: false