File: ci.yml

package info (click to toggle)
labelme 5.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 31,744 kB
  • sloc: python: 6,013; xml: 147; makefile: 22
file content (113 lines) | stat: -rw-r--r-- 3,710 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: ci

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  build:

    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]
        python-version: ['3.9']
        PYTEST_QT_API: [pyqt5, pyside2]

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true

    - uses: conda-incubator/setup-miniconda@v3
      with:
        auto-update-conda: true
        python-version: ${{ matrix.python-version }}

    # - 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 install --cask xquartz
    #     fi

    - name: Set up Python
      shell: bash -l {0}
      run: |
        conda install -q -y python=${{ matrix.python-version }}
        which python
        python --version
        pip --version

    - name: Install dependencies
      shell: bash -l {0}
      run: |
        if [ "${{ matrix.PYTEST_QT_API }}" = "pyside2" ]; then
          conda install -q -y pyside2 -c conda-forge
        # should be installed via pip
        # else
        #   conda install -q -y pyqt=5
        fi
        pip install -r requirements-dev.txt

    - name: Install main
      shell: bash -l {0}
      run: |
        pip install .

    - name: Run ruff
      shell: bash -l {0}
      if: matrix.os != 'windows-latest'
      run: |
        ruff format --check
        ruff check

    - name: Test with pytest
      shell: bash -l {0}
      if: matrix.os == 'ubuntu-latest'
      env:
        PYTEST_QT_API: ${{ matrix.PYTEST_QT_API }}
        MPLBACKEND: 'agg'
      run: |
        sudo apt-get update
        sudo apt-get install -y xvfb libqt5widgets5

        Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
        export DISPLAY=:99

        pytest tests

    - 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<5.0.0'  # 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'
      run: |
        # Build the standalone executable
        pip install pyinstaller
        pyinstaller labelme.spec
        dist/labelme --version