123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- name: ci
- on:
- push:
- branches:
- - master
- pull_request:
- jobs:
- build:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [macos-latest, ubuntu-latest, windows-latest]
- python-version: ['3.7', '2.7']
- PYTEST_QT_API: [pyqt5, pyqt4v2, pyside2]
- exclude:
- - os: macos-latest
- PYTEST_QT_API: pyqt4v2
- - os: macos-latest
- PYTEST_QT_API: pyside2
- - os: windows-latest
- PYTEST_QT_API: pyqt4v2
- - os: windows-latest
- PYTEST_QT_API: pyside2
- - python-version: '3.7'
- PYTEST_QT_API: pyqt4v2
- steps:
- - uses: actions/checkout@v1
- - uses: goanpeca/setup-miniconda@v1
- with:
- auto-update-conda: true
- python-version: ${{ matrix.python-version }}
- - name: Update submodules
- shell: bash -l {0}
- run: |
- git submodule update --init --recursive
- - name: Install system dependencies
- shell: bash -l {0}
- run: |
- if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
- sudo apt-get install -y coreutils
- sudo apt-get install -y xvfb herbstluftwm
- elif [ "${{ matrix.os }}" = "macos-latest" ]; then
- brew install coreutils
- brew cask install xquartz
- fi
- - name: Set up Python
- shell: bash -l {0}
- env:
- PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
- run: |
- conda install -q -y python=$PYTHON_VERSION
- which python
- python --version
- pip --version
- - name: Install dependencies
- shell: bash -l {0}
- run: |
- if [ "${{ matrix.PYTEST_QT_API }}" = "pyside2" ]; then
- if [ "${{ matrix.PYTHON_VERSION }}" = "2.7" ]; then
- conda install -q -y 'pyside2!=5.12.4' -c conda-forge
- else
- conda install -q -y pyside2 -c conda-forge
- fi
- elif [ "${{ matrix.PYTEST_QT_API }}" = "pyqt4v2" ]; then
- conda install -q -y pyqt=4 -c conda-forge
- else # pyqt5
- conda install -q -y pyqt=5
- fi
- if [ "${{ matrix.os }}" != "windows-latest" ]; then
- conda install -q -y help2man
- fi
- pip install hacking pytest pytest-qt
- - name: Install main
- shell: bash -l {0}
- run: |
- pip install .
- - name: Lint with flake8
- shell: bash -l {0}
- if: matrix.os != 'windows-latest'
- run: |
- flake8 .
- # - name: Black
- # shell: bash -l {0}
- # if: matrix.os != 'windows-latest' && matrix.python-version != '2.7'
- # run: |
- # pip install black
- # black --check .
- - name: Test with pytest
- shell: bash -l {0}
- if: matrix.os != 'windows-latest'
- env:
- PYTEST_QT_API: ${{ matrix.PYTEST_QT_API }}
- run: |
- # open virtual display
- if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
- export DISPLAY=:99.0
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
- (herbstluftwm )&
- else
- (sudo Xvfb :99 -ac -screen 0 1024x768x8 )&
- fi
- # run test
- MPLBACKEND='agg' pytest tests -m 'not gpu'
- - name: Run examples
- shell: bash -l {0}
- if: matrix.os != 'windows-latest'
- env:
- MPLBACKEND: agg
- run: |
- labelme --help
- labelme --version
- (cd examples/primitives && labelme_json_to_dataset primitives.json && rm -rf primitives_json)
- (cd examples/tutorial && 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 data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
- (cd examples/instance_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
- (cd examples/video_annotation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
- pip install lxml # for bbox_detection/labelme2voc.py
- (cd examples/bbox_detection && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
- pip install cython && pip install pycocotools # for instance_segmentation/labelme2coco.py
- (cd examples/instance_segmentation && rm -rf data_dataset_coco && ./labelme2coco.py data_annotated data_dataset_coco --labels labels.txt && git checkout -- .)
- - name: Run pyinstaller
- shell: bash -l {0}
- if: matrix.PYTEST_QT_API == 'pyqt5' && matrix.python-version == '3.7'
- run: |
- # Build the standalone executable
- pip install 'pyinstaller!=3.4'
- pip install 'setuptools<45.0.0'
- pyinstaller labelme.spec
- dist/labelme --version
|