-
Notifications
You must be signed in to change notification settings - Fork 42
66 lines (61 loc) · 2.38 KB
/
python-ci.yml
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
name: Detectree2 CI
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# permissions:
# contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10.6"
- name: Install code development dependencies
run: |
python3 --version
python -m pip install --upgrade pip
pip3 install flake8 pep8-naming pydocstyle pytest isort
pip3 install mypy data-science-types pandas-stubs types-pillow numpy==1.23.1
# if [ -f requirements/requirements.txt ]; then pip install -r requirements/requirements.txt; fi
- name: Install detectree2 dependencies
run: |
sudo apt install -yqq software-properties-common
sudo add-apt-repository -y ppa:ubuntugis/ppa
sudo apt -yqq update
sudo apt install -yqq libgdal-dev gdal-bin python3-pip git python3-opencv
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu \
opencv-python wandb sphinx
pip3 install wheel cython
pip3 install 'git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI'
pip3 install --no-build-isolation 'git+https://github.com/facebookresearch/detectron2.git'
- name: Install detectree2
run: |
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip3 install GDAL==3.3.2
pip3 install .
- name: flake8 checks
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 detectree2 --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 detectree2 --count --max-complexity=10 --statistics
- name: pytest checks
run: |
pip install pytest-order
pytest
- name: mypy checks
run: |
mypy detectree2
- name: isort checks
run: |
isort --check detectree2