.travis.yml 3.1 KB

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