.travis.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. sudo: false
  2. cache: pip
  3. matrix:
  4. include:
  5. - os: linux
  6. dist: trusty
  7. language: python
  8. env:
  9. - SYSTEM_PYTHON=/usr/bin/python
  10. - PIP=pip
  11. - PYTHON=python
  12. addons:
  13. apt:
  14. packages:
  15. - gfortran
  16. - liblapack-dev
  17. - pyqt4-dev-tools
  18. - python-qt4
  19. # FIXME: brew cannot be run on Travis.
  20. # - os: osx
  21. # osx_image: xcode8
  22. # language: generic
  23. # env:
  24. # - PYTHON_VERSION=2.7.10
  25. # - PYENV_ROOT=~/.pyenv
  26. # - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
  27. # - os: osx
  28. # osx_image: xcode9
  29. # language: generic
  30. # env:
  31. # - PYTHON_VERSION=2.7.10
  32. # - PYENV_ROOT=~/.pyenv
  33. # - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
  34. - os: linux
  35. dist: trusty
  36. language: python
  37. python: 2.7
  38. env:
  39. - USE_CONDA=true
  40. - os: linux
  41. dist: trusty
  42. language: python
  43. python: 3.6
  44. env:
  45. - USE_CONDA=true
  46. before_install:
  47. - if [ "$USE_CONDA" = "true" ]; then
  48. if [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then
  49. wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
  50. else
  51. wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
  52. fi;
  53. bash miniconda.sh -b -p $HOME/miniconda;
  54. export PATH="$HOME/miniconda/bin:$PATH";
  55. hash -r;
  56. conda config --set always_yes yes --set changeps1 no;
  57. conda update -q conda;
  58. conda info -a;
  59. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  60. which pyenv &>/dev/null || brew install --quiet pyenv;
  61. PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install -ks $PYTHON_VERSION;
  62. mkdir -p ~/.matplotlib;
  63. echo backend':' Agg > ~/.matplotlib/matplotlibrc;
  64. fi
  65. install:
  66. - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
  67. if [ "$USE_CONDA" = "true" ]; then
  68. conda create --name=labelme python=$TRAVIS_PYTHON_VERSION -q -y;
  69. conda install pyqt -q -y;
  70. conda install scikit-image -q -y;
  71. else
  72. cp -r $(dirname $($SYSTEM_PYTHON -c 'import PyQt4; print(PyQt4.__file__)')) ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  73. cp $($SYSTEM_PYTHON -c 'import sip; print(sip.__file__)') ~/virtualenv/python2.7/lib/python2.7/site-packages/;
  74. pip install -q -U pip setuptools;
  75. pip install -q -U numpy scipy scikit-image;
  76. fi;
  77. elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
  78. pyenv global $PYTHON_VERSION;
  79. brew install pyqt;
  80. cp -r /usr/local/lib/python2.7/site-packages/PyQt5 ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  81. cp /usr/local/lib/python2.7/site-packages/sip.so ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
  82. pip install -q -U pip setuptools;
  83. pip install -q -U numpy scipy scikit-image;
  84. fi
  85. - pip install .
  86. before_script:
  87. - pip install -q hacking pytest
  88. script:
  89. - flake8 .
  90. - pytest -v tests
  91. - labelme --help
  92. - (cd examples/single_image && 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 labels.txt data_annotated data_dataset_voc && git checkout -- .)
  94. - (cd examples/instance_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
  95. branches:
  96. only:
  97. - master
  98. notifications:
  99. email: false