.travis.yml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. language: generic
  2. sudo: required
  3. dist: trusty
  4. env:
  5. global:
  6. # used by ci-helpers
  7. - SETUP_XVFB=true PIP_DEPENDENCIES='hacking pytest pytest-qt'
  8. matrix:
  9. include:
  10. - os: linux
  11. dist: trusty
  12. env:
  13. - PYTEST_QT_API=pyqt4v2
  14. - PYQT_PACKAGE='pyqt=4'
  15. - PYTHON_VERSION=2.7.14
  16. - os: linux
  17. dist: trusty
  18. env:
  19. - PYTEST_QT_API=pyside2
  20. - CONDA_CHANNELS='conda-forge'
  21. - PYQT_PACKAGE='pyside2'
  22. - PYTHON_VERSION=2.7.14
  23. - os: linux
  24. dist: trusty
  25. env:
  26. - PYTEST_QT_API=pyside2
  27. - CONDA_CHANNELS='conda-forge'
  28. - PYQT_PACKAGE='pyside2'
  29. - PYTHON_VERSION=3.6.5
  30. - os: linux
  31. dist: trusty
  32. env:
  33. - PYTEST_QT_API=pyqt5
  34. - PYQT_PACKAGE='pyqt=5'
  35. - PYTHON_VERSION=2.7.14
  36. - os: linux
  37. dist: trusty
  38. env:
  39. - PYTEST_QT_API=pyqt5
  40. - PYQT_PACKAGE='pyqt=5'
  41. - PYTHON_VERSION=3.6.5
  42. - os: osx
  43. env:
  44. - PYTEST_QT_API=pyqt5
  45. - PYQT_PACKAGE='pyqt=5'
  46. - PYTHON_VERSION=3.6.5
  47. install:
  48. - |
  49. if [ $TRAVIS_OS_NAME = "linux" ]; then
  50. sudo apt-get update
  51. # Xvfb / window manager
  52. sudo apt-get install -y xvfb herbstluftwm
  53. fi
  54. # Setup miniconda
  55. - git clone --depth 1 git://github.com/astropy/ci-helpers.git
  56. - export __PATH__=$PATH
  57. - export __PYTHONPATH__=$PYTHONPATH
  58. - CONDA_DEPENDENCIES=$PYQT_PACKAGE source ci-helpers/travis/setup_conda.sh
  59. - source activate test && pip install .
  60. before_script:
  61. - "herbstluftwm &"
  62. - sleep 1
  63. script:
  64. - source activate test
  65. - flake8 examples labelme setup.py tests
  66. - |
  67. if [ $TRAVIS_OS_NAME = "linux" ]; then
  68. pytest -v tests
  69. fi
  70. - |
  71. if [ $TRAVIS_OS_NAME = "osx" ]; then
  72. export MPLBACKEND=TkAgg
  73. fi
  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/semantic_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  78. - (cd examples/instance_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  79. after_script:
  80. - |
  81. if [ $PYTHON_VERSION = "3.6.5" -a $PYQT_PACKAGE = "pyqt=5" ]; then
  82. # Cleanup
  83. export PATH=$__PATH__
  84. export PYTHONPATH=$__PYTHONPATH__
  85. # Setup pyenv
  86. git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv
  87. export PYENV_ROOT=$HOME/.pyenv
  88. export PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
  89. CONFIGURE_OPTS=--enable-shared pyenv install -ks $PYTHON_VERSION
  90. pyenv global $PYTHON_VERSION
  91. which python && python --version
  92. which pip && pip --version
  93. # Build the standalone executable
  94. pip install .
  95. pip uninstall -y matplotlib
  96. pip install pyinstaller
  97. pyinstaller labelme.spec
  98. dist/labelme --version
  99. fi
  100. branches:
  101. only:
  102. - master
  103. notifications:
  104. email: false