.travis.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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: osx
  13. env:
  14. - PYTEST_QT_API=pyqt5
  15. - PYQT_PACKAGE='pyqt=5'
  16. - PYTHON_VERSION=3.6
  17. - RUN_PYINSTALLER=true
  18. - os: linux
  19. dist: trusty
  20. env:
  21. - PYTEST_QT_API=pyqt4v2
  22. - PYQT_PACKAGE='pyqt=4'
  23. - PYTHON_VERSION=2.7
  24. - os: linux
  25. dist: trusty
  26. env:
  27. - PYTEST_QT_API=pyside2
  28. - CONDA_CHANNELS='conda-forge'
  29. - PYQT_PACKAGE='pyside2'
  30. - PYTHON_VERSION=2.7
  31. - os: linux
  32. dist: trusty
  33. env:
  34. - PYTEST_QT_API=pyside2
  35. - CONDA_CHANNELS='conda-forge'
  36. - PYQT_PACKAGE='pyside2'
  37. - PYTHON_VERSION=3.6
  38. - os: linux
  39. dist: trusty
  40. env:
  41. - PYTEST_QT_API=pyqt5
  42. - PYQT_PACKAGE='pyqt=5'
  43. - PYTHON_VERSION=2.7
  44. - os: linux
  45. dist: trusty
  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. before_script:
  66. - if [ $TRAVIS_OS_NAME = "linux" ]; then (herbstluftwm )& fi
  67. - if [ $TRAVIS_OS_NAME = "osx" ]; then (sudo Xvfb :99 -ac -screen 0 1024x768x8 )& fi
  68. - sleep 1
  69. script:
  70. - flake8 examples labelme setup.py tests
  71. - pytest -v tests
  72. - labelme --help
  73. - labelme --version
  74. - (cd examples/tutorial && rm -rf apc2016_obj3_json && labelme_json_to_dataset apc2016_obj3.json && python load_label_png.py && git checkout -- .)
  75. - (cd examples/bbox_detection && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  76. - (cd examples/semantic_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  77. - (cd examples/instance_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  78. - (cd examples/video_annotation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  79. after_script:
  80. - |
  81. if [ $RUN_PYINSTALLER = "true" ]; then
  82. # Cleanup
  83. pip uninstall -y $PIP_DEPENDENCIES
  84. # https://github.com/wkentaro/labelme/issues/183
  85. if [ $TRAVIS_OS_NAME = "osx" ]; then
  86. pip uninstall -y Pillow
  87. conda install -y Pillow
  88. fi
  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