.travis.yml 3.9 KB

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