.travis.yml 3.3 KB
Newer Older
1
sudo: false
K
Kentaro Wada 已提交
2

3
cache: pip
K
Kentaro Wada 已提交
4

5 6 7 8 9 10 11 12 13
matrix:
  include:
    - os: linux
      dist: trusty
      language: python
      env:
        - SYSTEM_PYTHON=/usr/bin/python
        - PIP=pip
        - PYTHON=python
K
Kentaro Wada 已提交
14
        - MPLBACKEND=Agg
15 16 17 18 19 20 21
      addons:
        apt:
          packages:
            - gfortran
            - liblapack-dev
            - pyqt4-dev-tools
            - python-qt4
K
Kentaro Wada 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    # FIXME: brew cannot be run on Travis.
    # - os: osx
    #   osx_image: xcode8
    #   language: generic
    #   env:
    #     - PYTHON_VERSION=2.7.10
    #     - PYENV_ROOT=~/.pyenv
    #     - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
    # - os: osx
    #   osx_image: xcode9
    #   language: generic
    #   env:
    #     - PYTHON_VERSION=2.7.10
    #     - PYENV_ROOT=~/.pyenv
    #     - PATH=$PYENV_ROOT/shims:$PATH:$PYENV_ROOT/bin
K
Kentaro Wada 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50
    - os: linux
      dist: trusty
      language: python
      python: 2.7
      env:
        - USE_CONDA=true
    - os: linux
      dist: trusty
      language: python
      python: 3.5
      env:
        - USE_CONDA=true

before_install:
K
Kentaro Wada 已提交
51
  - if [ "$USE_CONDA" = "true" ]; then
K
Kentaro Wada 已提交
52 53 54 55
      if [ "$TRAVIS_PYTHON_VERSION" = "2.7" ]; then
        wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
      else
        wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
K
Kentaro Wada 已提交
56
      fi;
K
Kentaro Wada 已提交
57 58 59 60 61 62 63
      bash miniconda.sh -b -p $HOME/miniconda;
      export PATH="$HOME/miniconda/bin:$PATH";
      hash -r;
      conda config --set always_yes yes --set changeps1 no;
      conda update -q conda;
      conda info -a;
    elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
K
Kentaro Wada 已提交
64
      which pyenv &>/dev/null || brew install --quiet pyenv;
K
Kentaro Wada 已提交
65 66
      PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install -ks $PYTHON_VERSION;
      mkdir -p ~/.matplotlib;
K
Kentaro Wada 已提交
67
      echo backend':' Agg > ~/.matplotlib/matplotlibrc;
K
Kentaro Wada 已提交
68
    fi
K
Kentaro Wada 已提交
69 70

install:
K
Kentaro Wada 已提交
71 72 73 74
  - if [ "$TRAVIS_OS_NAME" = "linux" ]; then
      if [ "$USE_CONDA" = "true" ]; then
        conda create --name=labelme python=$TRAVIS_PYTHON_VERSION -q -y;
        conda install pyqt=4 -q -y;
75
        conda install scikit-image -q -y;
K
Kentaro Wada 已提交
76 77 78
      else
        cp -r $(dirname $($SYSTEM_PYTHON -c 'import PyQt4; print(PyQt4.__file__)')) ~/virtualenv/python2.7/lib/python2.7/site-packages/;
        cp $($SYSTEM_PYTHON -c 'import sip; print(sip.__file__)') ~/virtualenv/python2.7/lib/python2.7/site-packages/;
K
Update  
Kentaro Wada 已提交
79 80
        pip install -q -U pip setuptools;
        pip install -q -U numpy scipy scikit-image;
K
Kentaro Wada 已提交
81
      fi;
K
Kentaro Wada 已提交
82 83 84 85 86
    elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
      pyenv global $PYTHON_VERSION;
      brew install pyqt;
      cp -r /usr/local/lib/python2.7/site-packages/PyQt5 ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
      cp /usr/local/lib/python2.7/site-packages/sip.so ~/.pyenv/versions/2.7.10/lib/python2.7/site-packages/;
K
Update  
Kentaro Wada 已提交
87 88
      pip install -q -U pip setuptools;
      pip install -q -U numpy scipy scikit-image;
K
Kentaro Wada 已提交
89
    fi
K
Update  
Kentaro Wada 已提交
90
  - pip install .
91 92

before_script:
K
Kentaro Wada 已提交
93
  - pip install -q pytest
K
Kentaro Wada 已提交
94 95

script:
K
Kentaro Wada 已提交
96
  - pytest -v tests
97 98 99
  - labelme --help
  - (cd examples/single_image && rm -rf apc2016_obj3_json && labelme_json_to_dataset apc2016_obj3.json && python load_label_png.py && git checkout -- .)
  - (cd examples/semantic_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py labels.txt data_annotated data_dataset_voc && git checkout -- .)
K
Kentaro Wada 已提交
100

K
Kentaro Wada 已提交
101 102 103 104
branches:
  only:
    - master

K
Kentaro Wada 已提交
105 106
notifications:
  email: false